/* Site header, desktop navigation and the mobile menu, over the photo hero
   that every page opens with. */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    color: var(--paper);
    background: linear-gradient(to bottom, rgb(0 0 0 / 0.6), transparent);
    transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease;
}

.site-header.scrolled {
    background-color: var(--ink);
}

/* Over the mobile menu: light type on ink, whatever colour a show's design
   gave the header (an ID, to win over those rules); the ink keeps the list
   from scrolling under the logo. */
body.menu-open #main-header {
    color: var(--paper);
    background: var(--ink);
}

/* Admin Bar Adjustments */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 0;
    }
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    /* Follows the header's colour as it changes, without a fade of its own
       lagging behind. */
    transition: none;
    font-family: var(--font-serif);
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 1001;
    /* Above mobile menu */
    position: relative;
}

.desktop-nav {
    display: none;
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.45em;
    transition: text-decoration-color var(--duration-normal) ease;
}

.nav-link:hover,
.nav-link[aria-current] {
    text-decoration-color: var(--gold);
}

/* ---------- Submenu under "Voorstellingen" (template-parts/nav-shows.php) ----------
   After Apple's menu: a panel across the whole width under the header, the
   page behind darkened. assets/js/theme.js opens it (.is-open) after a
   moment's hover, the arrow or keyboard focus, and closes it a moment after
   the pointer leaves, so passing over the menu does not make it flicker. */

.nav-item--shows {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-shows-toggle {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.nav-shows-toggle svg {
    width: 0.7rem;
    transition: transform var(--duration-normal) ease;
}

.nav-item--shows.is-open .nav-shows-toggle svg {
    transform: rotate(180deg);
}

.nav-shows ul {
    list-style: none;
}

.nav-show {
    color: inherit;
    text-decoration: none;
}

.nav-show-title {
    transition: color var(--duration-normal) ease;
}

.nav-show:hover .nav-show-title,
.nav-show:focus-visible .nav-show-title,
.nav-show[aria-current] .nav-show-title {
    color: var(--gold);
}

.nav-show-when {
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--muted-on-ink);
}

.nav-shows-heading {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gold);
}

.nav-shows-all {
    display: inline-block;
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.35em;
}

.nav-shows-all:hover {
    color: var(--gold);
}

/* While it is open, the header is solid ink with light type, whatever colour
   a show's design gave it (an ID, to win over those rules). */
body.nav-shows-open #main-header {
    background-color: var(--ink);
    color: var(--paper);
}

.nav-shows-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0;
    /* Darker only, no blur: Safari let a backdrop blur run up into the header
       (a light glow and a smeared gold underline). */
    background-color: rgb(0 0 0 / 0.6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s;
}

body.nav-shows-open .nav-shows-backdrop {
    opacity: 1;
    visibility: visible;
}

/* ---------- The panel on desktop ---------- */

.nav-shows--desktop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2;
    padding-block: var(--space-xl) var(--space-2xl);
    border-top: 1px solid var(--line-on-ink);
    color: var(--paper);
    background-color: var(--ink);
    box-shadow: 0 2rem 3rem rgb(0 0 0 / 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.nav-item--shows.is-open .nav-shows--desktop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

/* The shows appear one after another. */
.nav-shows--desktop :is(.nav-show, .nav-shows-all, .nav-shows-buy) {
    opacity: 0;
    transform: translateY(-0.35rem);
    transition: opacity 0.3s ease, transform 0.3s ease, color var(--duration-normal) ease;
}

.nav-item--shows.is-open .nav-shows--desktop :is(.nav-show, .nav-shows-all, .nav-shows-buy) {
    opacity: 1;
    transform: none;
    transition-delay: calc(0.05s + var(--i, 0) * 0.03s);
}

@media (prefers-reduced-motion: reduce) {
    .nav-shows--desktop,
    .nav-shows--desktop :is(.nav-show, .nav-shows-all, .nav-shows-buy) {
        transform: none;
        transition-delay: 0s !important;
    }
}

.nav-shows--desktop .nav-shows-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: var(--space-2xl);
    align-items: start;
    width: min(100% - 2 * var(--gutter), var(--content-max));
    margin-inline: auto;
}

/* Coming up: large, with the ticket button. */
.nav-shows--desktop .nav-shows-col--upcoming .nav-show {
    display: block;
    padding-block: 0.15rem 0.5rem;
}

.nav-shows--desktop .nav-shows-col--upcoming .nav-show-title {
    display: block;
    font-family: var(--font-serif);
    font-size: var(--text-4xl);
    font-style: italic;
    line-height: 1;
}

.nav-shows--desktop .nav-shows-col--upcoming .nav-show-when {
    font-size: var(--text-base);
    color: var(--paper);
}

.nav-shows--desktop .nav-shows-col--upcoming li + li {
    margin-top: var(--space-md);
}

.nav-shows-buy {
    margin-top: var(--space-sm);
}

/* Played: quieter, one column on the right, behind a line. */
.nav-shows--desktop .nav-shows-col--played {
    padding-left: var(--space-xl);
    border-left: 1px solid var(--line-on-ink);
}

.nav-shows--desktop .nav-shows-col--played .nav-shows-heading {
    color: var(--muted-on-ink);
}

.nav-shows--desktop .nav-shows-col--played .nav-show {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    max-width: 22rem;
    padding-block: 0.3rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgb(255 255 255 / 0.75);
}

/* The next show's photo, beside its title: on a wide screen only. */
.nav-shows-feature {
    display: none;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.nav-shows-feature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 1024px) {
    .nav-shows--desktop .nav-shows-inner {
        grid-template-columns: 22rem 1fr 1fr;
    }

    .nav-shows--desktop .nav-shows-inner:not(:has(> :nth-child(3))) {
        grid-template-columns: 22rem 1fr;
    }

    .nav-shows-feature {
        display: block;
    }
}

/* ---------- In the mobile menu ----------
   The list is the menu: the three items small in a row on top, the shows
   underneath as on a theatre's repertoire, the titles in the serif upright
   (the italic read poorly this small). */

.nav-shows--mobile {
    order: 1;
    flex-basis: 100%;
    margin-top: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gold);
}

.nav-shows--mobile .nav-shows-col + .nav-shows-col {
    margin-top: var(--space-xl);
}

.nav-shows--mobile .nav-show-title {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.1;
}

.nav-shows--mobile .nav-show-when {
    font-size: var(--text-sm);
}

.nav-shows--mobile .nav-shows-col--upcoming .nav-show {
    display: grid;
    padding-block: 0.25rem;
}

.nav-shows--mobile .nav-shows-col--upcoming .nav-show-title {
    font-size: var(--text-4xl);
}

.nav-shows--mobile .nav-shows-col--played .nav-show {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    padding-block: 0.45rem;
    border-bottom: 1px solid var(--line-on-ink);
}

.nav-shows--mobile .nav-shows-col--played .nav-show-title {
    font-size: var(--text-xl);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: block;
    z-index: 1001;
    position: relative;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
}

@media (min-width: 640px) {
    .desktop-nav {
        display: flex;
        gap: var(--space-lg);
    }

    .mobile-menu-toggle {
        display: none;
    }
}

.hamburger-line {
    position: absolute;
    left: 10px;
    width: 24px;
    height: 2px;
    background-color: currentColor;
    transition: transform var(--duration-normal) ease, opacity var(--duration-normal) ease;
}

.line-1 {
    top: 14px;
}

.line-2 {
    top: 21px;
}

.line-3 {
    top: 28px;
}

body.menu-open .line-1 {
    transform: translateY(7px) rotate(45deg);
}

body.menu-open .line-2 {
    opacity: 0;
}

body.menu-open .line-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--ink);
    color: var(--paper);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    /* With the list of shows it can be taller than the screen. */
    overflow-y: auto;
    padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-xl);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal) ease, visibility var(--duration-normal) ease;
}

/* The three items in a row; the list of shows wraps below them. */
.mobile-menu-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-lg);
}

body.menu-open .mobile-menu-overlay {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-link {
    font-size: var(--text-base);
    font-weight: 500;
}

.mobile-nav-link[aria-current] {
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 0.45em;
    text-decoration-thickness: 1.5px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
