/* Header and announcement bar, moved from the old style.css. Only the colours follow the theme;
   in the light theme they resolve to the original values. */

.announcement {
    display: flex;
    height: 30px;
    flex-direction: row;
    background: var(--c-surface);
    color: var(--c-text);
    position: fixed;
    top: 0;
    width: 100%;
    padding: 10px;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    text-decoration: none;
    gap: 10px;
    z-index: 100;
    overflow: hidden;
}

/* Slides sit on top of each other; the active one slides in from below */
.announcement__item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s linear 0.4s;
}

.announcement__item.is-active {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.announcement__item.is-leaving {
    transform: translateY(-100%);
}

.announcement__name {
    font-weight: var(--fw-semibold);
}

.announcement__name::after {
    content: "•";
    margin-left: 8px;
    font-weight: var(--fw-regular);
    color: var(--c-text-muted);
}

.announcement__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--c-text-muted);
    transition: color var(--ease);
}

.announcement__arrow {
    color: var(--c-icon);
    transition: transform var(--ease);
}

.announcement__item:hover .announcement__text {
    color: var(--c-text);
}

.announcement__item:hover .announcement__arrow {
    transform: translateX(3px);
}

.announcement__text--short {
    display: none;
}

@media (max-width: 600px) {
    .announcement__text {
        display: none;
    }

    .announcement__text--short {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    .announcement__item,
    .announcement__item.is-active {
        transform: none;
        transition: none;
    }
}

.header {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    align-content: center;
    position: fixed;
    z-index: 10;
    top: 30px;
}

.header .header-wrapper {
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
    width: 100%;
    height: 64px;
    border-radius: 40px;
    padding: 20px 20px 20px 30px;
    max-width: 1160px;
    place-content: center space-between;
    position: relative;
    overflow: visible;
    backdrop-filter: blur(10px);
    background-color: var(--c-header);
    box-shadow: rgba(0, 0, 0, 0.11) 0px 0.602187px 0.602187px -1.25px,
                rgba(0, 0, 0, 0.1) 0px 2.28853px 2.28853px -2.5px,
                rgba(0, 0, 0, 0.04) 0px 10px 10px -3.75px;
}

.header-nav-wrapper {
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
    gap: 40px;
    flex-grow: 0;
}

.mobile-nav-wrapper {
    display: flex;
    flex-flow: row;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
}

.header .logo,
.header .logo img {
    display: block;
}

.menu {
    display: flex;
    flex-flow: row;
    align-content: center;
    align-items: center;
    gap: 20px;
}

.menu .menu-item {
    position: relative;
}

/* Login and Start Now inside the menu: mobile only (see the media query below) */
.menu .menu-cta {
    display: none;
}

.menu a {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.15px;
    text-decoration: none;
    color: var(--c-text);
    transition: 0.2s ease all;
}

.menu a:hover {
    color: var(--brand);
}

.cta-wrapper {
    display: flex;
    flex-flow: row;
    align-content: center;
    align-items: center;
    gap: 5px;
}

/* Login and Start Now: the site's .btn-ghost / .btn-brand, as round pills */
.header .header-btn {
    height: 40px;
    padding: 0 32px;
    border-radius: 100px;
    font-size: 15px;
}

.menu .dropdown-wrapper {
    position: absolute;
    left: -10px;
    top: calc(100% + 30px);
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 10px;
    background: var(--c-surface);
    border-radius: 10px;
    box-shadow: 0px 3px 10px rgba(0,0,0,0.1);
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    pointer-events: none;
    z-index: 999;
}

.dropdown:hover .dropdown-wrapper,
.dropdown:focus-within .dropdown-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.dropdown-wrapper::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 30px;
  width: 100px;
}

.menu .dropdown-pill {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 5px;
    border-radius: 5px;
    width: 320px;
    font-size: 14px;
    color: var(--c-text-muted);
}

.menu .dropdown-pill:hover {
    background: var(--c-bg);
}

.menu .dropdown-pill .icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--c-bg);
    display: flex;
    justify-content: center;
    align-content: center;
    align-items: center;
    border-radius: 5px;
}

.menu .dropdown-pill .icon-wrapper img {
    display: block;
    width: 24px;
    height: 24px;
}

.menu .dropdown-pill .dropdown-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--c-text);
}

@media (max-width: 960px) {
    /* As on mubert.com: a 40px pill 8px from the edges, a small logo and 32px buttons */
    .header {
        padding: 4px 8px;
    }
    .header .header-wrapper {
        height: auto;
        min-height: 40px;
        padding: 4px 16px 4px 20px;
        align-items: flex-start;
        border-radius: 20px;
        background: var(--c-surface);
    }
    .header-nav-wrapper {
        flex-grow: 1;
        flex-direction: column;
        min-width: 0;
    }
    .header .logo img {
        height: 11px;
        width: auto;
    }
    .theme-toggle--mobile {
        width: 32px;
        height: 32px;
    }
    .theme-toggle--mobile svg {
        width: 18px;
        height: 18px;
    }
    /* Login and Start Now move from the bar into the opened menu */
    .header .cta-wrapper {
        display: none;
    }
    .header .menu .menu-cta {
        display: flex;
        gap: 8px;
        width: 100%;
        margin: 4px 0 8px;
    }
    .header .menu-cta .header-btn {
        flex: 1;
        padding: 0 16px;
        font-weight: var(--fw-semibold);
    }
    /* .menu a would recolour them */
    .header .menu-cta .btn-brand,
    .header .menu-cta .btn-brand:hover {
        color: #fff;
    }
    .header .menu-cta .btn-ghost,
    .header .menu-cta .btn-ghost:hover {
        color: var(--c-text);
    }
    .header .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        align-content: flex-start;
        align-items: flex-start;
    }
    .mobile-nav-wrapper {
        width: 100%;
        height: 32px;
        padding-right: 0;
        box-sizing: border-box;
    }
    .header .menu .dropdown-wrapper {
        position: relative;
        visibility: visible;
        opacity: 1;
        background: none;
        box-shadow: none;
        transform: translateX(0);
    }
    /* No tiles in the mobile menu: bare icons next to the names */
    .menu .dropdown-pill .icon-wrapper {
        width: 24px;
        height: 24px;
        background: none;
    }
    .menu .dropdown-pill .icon-wrapper img {
        width: 20px;
        height: 20px;
    }
    .header .menu .dropdown-wrapper .dropdown-pill .dropdown-subtitle {
        display: none;
    }
    /* Double taps and clicks on the burger would otherwise select the whole menu's text */
    .header .header-wrapper {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    .menu-button-burger {
        background: url("../../images/icons/menu.svg");
        width: 24px;
        height: 24px;
        display: block;
        float: right;
        cursor: pointer;
        background-size: cover;
    }
    .menu-button-burger.close {
        background: url("../../images/icons/close.svg");
        background-size: cover;
    }
}
