/* The public site's layout - colours, fonts and buttons come from theme.css */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-skip {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: var(--x-yellow);
    color: #232323;
    padding: 6px 12px;
}

/* The header stays at the top: it slides away while scrolling down and comes back on the way up
   (public/js/site.js adds .is-hidden and .is-scrolled) */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--x-line);
    transition: transform .3s ease, box-shadow .3s ease;
}

.site-header.is-hidden {
    transform: translateY(-100%);
}

.site-header.is-scrolled {
    box-shadow: 0 4px 18px rgba(35, 35, 35, .08);
}

/* On the home page the header starts see-through over the yellow hero, and turns white once the
   page scrolls (layouts/app: headerOver) */
.site-header-over {
    transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease, border-color .3s ease;
}

.site-header-over:not(.is-scrolled) {
    background: transparent;
    border-bottom-color: transparent;
}

.site-header-over:not(.is-scrolled) .btn-primary {
    --bs-btn-bg: #232323;
    --bs-btn-border-color: #232323;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: #000;
    --bs-btn-hover-border-color: #000;
    --bs-btn-hover-color: #fff;
}

.site-header-over:not(.is-scrolled) .site-social a:hover,
.site-header-over:not(.is-scrolled) .site-social a:focus-visible {
    background: #fff;
}

.site-header-over:not(.is-scrolled) .site-nav .nav-link:hover,
.site-header-over:not(.is-scrolled) .site-nav .nav-link:focus {
    text-decoration-color: #232323;
}

/* The open phone menu needs a background to be readable */
.site-header-over:not(.is-scrolled):has(.navbar-collapse.show) {
    background: var(--x-yellow);
}

.site-nav {
    padding: 14px 24px;
}

/* Wide screens: logo | menu, centred on the page | cart and social links */
@media (min-width: 992px) {
    .site-nav {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .site-nav .site-menu {
        display: contents !important;
    }

    .site-nav-end {
        justify-self: end;
    }
}

.site-nav-end {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-social {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: .85rem;
    color: var(--x-charcoal);
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.site-social a:hover,
.site-social a:focus-visible {
    background: var(--x-yellow);
    color: #232323;
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .site-nav-end {
        padding: 12px 0 4px;
        border-top: 1px solid var(--x-line);
        margin-top: 8px;
    }
}

/* Back to the top: shows once the page is scrolled half a screen (public/js/site.js) */
.site-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #232323;
    color: var(--x-yellow);
    box-shadow: 0 8px 24px rgba(35, 35, 35, .25);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease, background-color .2s ease, color .2s ease;
}

.site-to-top.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.site-to-top:hover,
.site-to-top:focus-visible {
    background: var(--x-yellow);
    color: #232323;
    transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-social a,
    .site-to-top {
        transition: none;
    }
}

.site-logo {
    display: inline-flex;
    align-items: center;
}

/* The wordmark is drawn at twice its size, so it stays sharp on high-resolution screens */
.site-logo img {
    display: block;
    width: 163px;
    max-width: 52vw;
    height: auto;
}

.site-nav .nav-link {
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--x-charcoal);
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus {
    color: #000;
    text-decoration: underline;
    text-decoration-color: var(--x-yellow-strong);
}

.site-main {
    flex: 1;
    padding: 56px 0;
}

.site-footer {
    background: #232323;
    color: #bdbdbd;
    padding: 22px 0;
    font-size: .85rem;
}

/* Home page hero: yellow, with the circle motif */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--x-yellow);
    color: #232323;
    padding: 96px 0 104px;
}

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border: 14px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 260px;
    height: 260px;
    right: 8%;
    top: -60px;
}

.hero::after {
    width: 150px;
    height: 150px;
    left: 4%;
    bottom: -40px;
}

.hero-words {
    font-size: clamp(2.6rem, 7vw, 4.8rem);
    font-weight: 700;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: -.02em;
    color: #232323;
    margin: 0 0 18px;
}

.hero-words span {
    display: block;
}

.hero-words .boxed {
    display: inline-block;
    background: #232323;
    color: var(--x-yellow);
    padding: 0 .15em;
}

.hero-words .light {
    font-weight: 300;
}

.hero-tagline {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 32px;
}

.hero .btn-dark {
    --bs-btn-padding-x: 1.6rem;
    --bs-btn-padding-y: .7rem;
}

/* Login, register, account ... */
.auth-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--bs-body-bg);
    padding: 36px;
    border-radius: var(--x-radius);
    box-shadow: var(--x-shadow);
    border-top: 5px solid var(--x-yellow);
}

.auth-card-wide {
    max-width: 520px;
}

.auth-card h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.auth-card h1::after {
    content: '.';
    color: var(--x-yellow-strong);
}

.auth-card legend {
    font-size: 1rem;
    font-weight: 600;
    color: var(--x-charcoal);
    margin-top: 10px;
}

.auth-links {
    margin: 22px 0 0;
    text-align: center;
    font-size: .875rem;
}

.site-main:has(.auth-card) {
    background: var(--x-grey-light);
}

/* Error pages */
.error-page {
    text-align: center;
    padding: 24px 0;
}

.error-status {
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 700;
    line-height: 1;
    color: #232323;
    margin: 0 0 8px;
}

.error-status span {
    background: var(--x-yellow);
    padding: 0 .12em;
}

.error-details {
    text-align: left;
    margin-top: 40px;
}

.error-details pre {
    white-space: pre-wrap;
    word-break: break-word;
}

/* The registration form's hidden spam trap - off-screen rather than display:none, which some bots skip */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Installer steps */
.install-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: .8rem;
    color: #8a8a8a;
}

.install-steps .active {
    color: var(--x-charcoal);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--x-yellow-strong);
    text-decoration-thickness: 3px;
}

.install-steps .done {
    color: #2e7d32;
}
