/**
 * Artspod v2 — header / footer shell + responsive nav.
 */

/* ---------- Header ---------- */
.aspv2 .asp-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--asp-line);
}

.aspv2 .asp-header__inner {
    display: flex;
    align-items: center;
    gap: var(--asp-sp-3);
    height: 64px;
}

.aspv2 .asp-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}

.aspv2 .asp-logo img {
    height: 26px;
    width: auto;
}

@media (max-width: 600px) {
    .aspv2 .asp-logo img {
        height: 22px;
    }
}

/* Nav fills remaining space, items flush right near search */
.aspv2 .asp-nav {
    flex: 1;
    min-width: 0;
}

.aspv2 .asp-nav__list {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.aspv2 .asp-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.aspv2 .asp-nav__link {
    color: var(--asp-slate);
    font-weight: 500;
    font-size: 13px;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aspv2 .asp-nav__link:hover,
.aspv2 .asp-nav__item:hover .asp-nav__link,
.aspv2 .asp-nav__link[aria-current="page"] {
    color: var(--asp-primary);
}

/* Dropdown toggle chevron */
.aspv2 .asp-nav__toggle {
    background: none;
    border: 0;
    padding: 6px 6px 6px 0;
    margin-left: -4px;
    cursor: pointer;
    color: var(--asp-gray);
    line-height: 0;
    display: inline-flex;
}

.aspv2 .asp-nav__toggle svg {
    transition: transform var(--asp-transition);
}

.aspv2 .asp-nav__item:hover .asp-nav__toggle svg,
.aspv2 .asp-nav__toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
    color: var(--asp-primary);
}

/* ---------- Dropdown panels (desktop) ---------- */
.aspv2 .asp-nav__panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--asp-line);
    border-radius: var(--asp-radius);
    box-shadow: var(--asp-shadow);
    padding: var(--asp-sp-2);
    margin-top: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* Instant on open, delayed on close — same reasoning as the search
       dropdown below: while `visibility` is still transitioning the panel
       counts as hidden, so its links are not focusable and Tab skips straight
       past the open menu. */
    transition: opacity var(--asp-transition), transform var(--asp-transition), visibility 0s linear 160ms;
}

/* Open on hover (desktop) or when toggled open (keyboard/click) */
.aspv2 .asp-nav__item:hover > .asp-nav__panel,
.aspv2 .asp-nav__item:focus-within > .asp-nav__panel,
.aspv2 .asp-nav__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--asp-transition), transform var(--asp-transition), visibility 0s;
}

/* Keep the last panels from spilling off the right edge */
.aspv2 .asp-nav__item:last-child .asp-nav__panel,
.aspv2 .asp-nav__item:nth-last-child(2) .asp-nav__panel {
    left: auto;
    right: 0;
}

.aspv2 .asp-nav__sub li a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--asp-radius-sm);
    color: var(--asp-slate);
    font-size: var(--asp-fs-sm);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.aspv2 .asp-nav__sub li a:hover {
    background: var(--asp-bg-blue);
    color: var(--asp-primary);
}

/* Mega panel: multi-column links + AdRotate promo */
.aspv2 .asp-nav__panel--mega {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--asp-sp-4);
    min-width: 680px;
    padding: var(--asp-sp-3);
}

.aspv2 .asp-nav__panel--mega .asp-nav__sub {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 2px var(--asp-sp-3);
    align-content: start;
}

.aspv2 .asp-nav__promo {
    max-width: 360px;
    align-self: center;
}

.aspv2 .asp-nav__promo img {
    border-radius: var(--asp-radius-sm);
}

.aspv2 .asp-header__actions {
    display: flex;
    align-items: center;
    gap: var(--asp-sp-3);
}

.aspv2 .asp-iconbtn {
    background: none;
    border: 0;
    padding: 6px;
    cursor: pointer;
    color: var(--asp-slate);
    line-height: 0;
}

.aspv2 .asp-navtoggle {
    display: none;
}

/* ---------- Search dropdown ---------- */
.aspv2 .asp-header__actions {
    position: relative;
}

.aspv2 .asp-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    width: 360px;
    background: #fff;
    border: 1px solid var(--asp-line);
    border-radius: var(--asp-radius);
    box-shadow: var(--asp-shadow);
    padding: var(--asp-sp-3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* Visibility flips instantly on open and only waits out the fade on close.
       Transitioning it in both directions leaves the panel `hidden` for the
       first frame, which makes the input unfocusable exactly when the toggle
       handler calls focus() — and deferring that focus to a timer would stop
       iOS opening the keyboard, since it only does so inside the tap. */
    transition: opacity var(--asp-transition), transform var(--asp-transition), visibility 0s linear 160ms;
}

.aspv2 .asp-search-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity var(--asp-transition), transform var(--asp-transition), visibility 0s;
}

.aspv2 .asp-search-form {
    display: flex;
    align-items: center;
    gap: var(--asp-sp-1);
}

.aspv2 .asp-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--asp-line);
    border-radius: var(--asp-radius-sm);
    font-family: var(--asp-font);
    font-size: var(--asp-fs-sm);
    color: var(--asp-ink);
    background: var(--asp-bg-soft);
    outline: none;
}

.aspv2 .asp-search-input:focus {
    border-color: var(--asp-primary);
}

.aspv2 .asp-search-input::placeholder {
    color: var(--asp-gray);
}

.aspv2 .asp-search-submit {
    flex-shrink: 0;
    color: var(--asp-primary);
}

/* ---------- Footer ---------- */
.aspv2 .asp-footer {
    background: var(--asp-ink);
    color: #cbd5e1;
    padding-block: var(--asp-sp-6) var(--asp-sp-4);
    margin-top: var(--asp-sp-6);
}

.aspv2 .asp-footer h3 {
    color: #fff;
    font-size: var(--asp-fs-lg);
    margin-bottom: var(--asp-sp-3);
}

.aspv2 .asp-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: var(--asp-sp-6);
    padding-bottom: var(--asp-sp-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.aspv2 .asp-footer__panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--asp-radius);
    padding: var(--asp-sp-4);
}

.aspv2 .asp-newsletter {
    display: flex;
    flex-wrap: wrap;
    gap: var(--asp-sp-2);
    margin-top: var(--asp-sp-3);
}

.aspv2 .asp-newsletter input,
.aspv2 .asp-newsletter select {
    flex: 1 1 180px;
    padding: 11px 14px;
    border-radius: var(--asp-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: var(--asp-fs-sm);
}

.aspv2 .asp-newsletter input::placeholder {
    color: #94a3b8;
}

.aspv2 .asp-footer__label {
    font-size: var(--asp-fs-xs);
    color: #94a3b8;
    margin-bottom: 4px;
    display: block;
}

.aspv2 .asp-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--asp-sp-3);
    padding-top: var(--asp-sp-4);
}

.aspv2 .asp-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--asp-sp-4);
}

.aspv2 .asp-footer__links a {
    color: #cbd5e1;
    font-size: var(--asp-fs-sm);
}

.aspv2 .asp-footer__links a:hover {
    color: #fff;
}

.aspv2 .asp-footer__brand {
    display: inline-flex;
    line-height: 0;
}

.aspv2 .asp-footer__brand img {
    height: 30px;
    width: auto;
    /* Wordmark has dark ink; invert to a clean white on the dark footer. */
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.aspv2 .asp-footer__copy {
    font-size: var(--asp-fs-xs);
    color: #94a3b8;
    margin-top: 4px;
}

.aspv2 .asp-social {
    display: flex;
    gap: var(--asp-sp-2);
}

.aspv2 .asp-social a {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--asp-radius-pill);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: background var(--asp-transition), color var(--asp-transition);
}

.aspv2 .asp-social a:hover {
    background: var(--asp-primary);
    color: #fff;
}

/* Normalise every social glyph to one optical size (fixes FB-too-small,
   X-too-large) — same box, same viewBox, balanced paths. */
.aspv2 .asp-social svg {
    width: 18px;
    height: 18px;
    display: block;
}

.aspv2 .asp-footer__cta {
    display: flex;
    gap: var(--asp-sp-2);
    margin-top: var(--asp-sp-3);
    flex-wrap: wrap;
}

/* Ghost button on a dark surface */
.aspv2 .asp-btn--onlight {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.aspv2 .asp-btn--onlight:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ---------- Mobile bottom tab bar ---------- */
.aspv2 .asp-tabbar {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
    .aspv2 .asp-header__inner {
        gap: var(--asp-sp-2);
    }

    .aspv2 .asp-header__actions {
        margin-left: auto;
    }

    .aspv2 .asp-navtoggle {
        display: inline-flex;
    }

    .aspv2 .asp-nav {
        position: fixed;
        inset: 64px 0 0 0;
        background: #fff;
        border-top: 1px solid var(--asp-line);
        padding: var(--asp-sp-2) var(--asp-gutter) 80px;
        margin: 0;
        flex: none;
        overflow: hidden;
        overflow-y: auto;
        transform: translateY(-120%);
        transition: transform 220ms ease;
        box-shadow: var(--asp-shadow);
    }

    .aspv2 .asp-nav.is-open {
        transform: translateY(0);
    }

    .aspv2 .asp-nav__list {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }

    .aspv2 .asp-nav__item {
        flex-wrap: wrap;
        border-bottom: 1px solid var(--asp-line);
    }

    .aspv2 .asp-nav__link {
        flex: 1;
        padding: 14px 0;
        font-size: var(--asp-fs-body);
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* Chevron becomes the accordion toggle */
    .aspv2 .asp-nav__toggle {
        padding: 14px 8px;
        margin: 0;
    }

    /* Dropdowns become inline accordions on mobile */
    .aspv2 .asp-nav__panel,
    .aspv2 .asp-nav__panel--mega {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        width: 100%;
        flex-basis: 100%;
        min-width: 0;
        grid-template-columns: 1fr;
        border: 0;
        box-shadow: none;
        padding: 0 0 var(--asp-sp-2) var(--asp-sp-2);
        margin: 0;
    }

    .aspv2 .asp-nav__panel.is-open {
        display: block;
    }

    .aspv2 .asp-nav__panel--mega .asp-nav__sub {
        grid-template-columns: 1fr;
    }

    .aspv2 .asp-nav__promo {
        max-width: 100%;
        margin-top: var(--asp-sp-2);
    }

    .aspv2 .asp-footer__top {
        grid-template-columns: 1fr;
        gap: var(--asp-sp-4);
    }

    .aspv2 .asp-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        display: flex;
        justify-content: space-around;
        background: #fff;
        border-top: 1px solid var(--asp-line);
        padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    }

    .aspv2 .asp-tabbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 11px;
        color: var(--asp-gray);
        font-weight: 500;
    }

    .aspv2 .asp-tabbar a.is-active {
        color: var(--asp-primary);
    }

    .aspv2 .asp-main {
        padding-bottom: 72px;
    }

    .aspv2 .asp-search-dropdown {
        width: calc(100vw - var(--asp-gutter) * 2);
        right: calc(-1 * var(--asp-gutter));
    }
}

/* ---------- Cards (shared base) ----------
   Canonical .asp-card component, used by every v2 page type (home sections,
   content listings, article prose-blocks). Was originally in home.css;
   moved here in Phase 4 so listing/article pages get it without home.css.
   Per-context overrides (aspect ratios, variants) stay in the page CSS. */
.aspv2 .asp-card {
    background: #fff;
    border: 1px solid var(--asp-line);
    border-radius: var(--asp-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--asp-transition), box-shadow var(--asp-transition);
}

.aspv2 .asp-card:hover,
.aspv2 .asp-card:focus-within {
    transform: translateY(-3px);
    box-shadow: var(--asp-shadow);
}

/* The image link is decorative (aria-hidden); the title link owns focus. */
.aspv2 .asp-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--asp-bg-blue);
    overflow: hidden;
    cursor: pointer;
}

.aspv2 .asp-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aspv2 .asp-card__badge {
    position: absolute;
    top: var(--asp-sp-2);
    left: var(--asp-sp-2);
}

.aspv2 .asp-card__body {
    padding: var(--asp-sp-3);
    display: flex;
    flex-direction: column;
    gap: var(--asp-sp-2);
    flex: 1;
}

.aspv2 .asp-card__title {
    font-size: var(--asp-fs-h3);
    color: var(--asp-ink);
}

.aspv2 .asp-card__title a {
    color: inherit;
}

.aspv2 .asp-card__title a:hover {
    color: var(--asp-primary);
}

.aspv2 .asp-card__excerpt {
    font-size: var(--asp-fs-sm);
    color: var(--asp-gray);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspv2 .asp-card__cta {
    margin-top: auto;
    font-weight: 600;
    font-size: var(--asp-fs-sm);
}

/* Generic content card (card-content.php) — landscape media everywhere. */
.aspv2 .asp-content-card .asp-card__media {
    aspect-ratio: 16 / 9;
}

/* ---------- Event card (canonical) ----------
   THE one .asp-ecard ruleset (template-parts/events/card.php), used by the
   events listing, whats-on/city grids, and the homepage Upcoming Shows row.
   Look chosen in Phase 4b: the whats-on variant (soft shadow, bottom-left
   dark genre pill, 16/9 media) plus flex:1 on the body so the "View Show"
   button pins to the bottom and rows align regardless of content length. */
.aspv2 .asp-ecard {
    display: flex;
    flex-direction: column;
    background: var(--asp-bg);
    border: 1px solid var(--asp-line);
    border-radius: var(--asp-radius);
    overflow: hidden;
    box-shadow: var(--asp-shadow-sm);
    transition: box-shadow var(--asp-transition), transform var(--asp-transition);
}

.aspv2 .asp-ecard:hover,
.aspv2 .asp-ecard:focus-within {
    box-shadow: var(--asp-shadow);
    transform: translateY(-2px);
}

.aspv2 .asp-ecard__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--asp-bg-soft);
    overflow: hidden;
}

.aspv2 .asp-ecard__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aspv2 .asp-ecard__pill {
    position: absolute;
    left: var(--asp-sp-2);
    bottom: var(--asp-sp-2);
    background: rgba(11, 28, 48, 0.72);
    color: #fff;
    font-size: var(--asp-fs-xs);
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 4px 10px;
    border-radius: var(--asp-radius-pill);
    white-space: nowrap;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.aspv2 .asp-ecard__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--asp-sp-1);
    padding: var(--asp-sp-3);
}

.aspv2 .asp-ecard__title {
    font-size: var(--asp-fs-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--asp-ink);
    margin: 0;
}

.aspv2 .asp-ecard__title a {
    color: inherit;
    text-decoration: none;
}

.aspv2 .asp-ecard__title a:hover {
    color: var(--asp-primary);
}

.aspv2 .asp-ecard__excerpt {
    font-size: var(--asp-fs-sm);
    color: var(--asp-gray);
    line-height: 1.5;
    margin: 0;
}

.aspv2 .asp-ecard__meta {
    display: flex;
    flex-direction: column;
    gap: var(--asp-sp-1);
    margin-top: auto;
    padding-top: var(--asp-sp-2);
}

.aspv2 .asp-ecard__venue,
.aspv2 .asp-ecard__dates {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--asp-fs-xs);
    color: var(--asp-gray);
    margin: 0;
}

.aspv2 .asp-ecard__venue svg,
.aspv2 .asp-ecard__dates svg {
    flex-shrink: 0;
}

.aspv2 .asp-ecard__venue a {
    color: inherit;
}

.aspv2 .asp-ecard__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--asp-sp-2);
    padding: 8px 16px;
    font-size: var(--asp-fs-sm);
    font-weight: 600;
    color: var(--asp-primary);
    border: 1px solid var(--asp-line-strong);
    border-radius: var(--asp-radius-pill);
    text-decoration: none;
    transition: border-color var(--asp-transition), color var(--asp-transition);
}

.aspv2 .asp-ecard__btn:hover {
    border-color: var(--asp-primary);
    color: var(--asp-primary-dark);
}
