/* Escena 360 - public site styles.
   System font stack (no third-party font requests), light/dark tokens via prefers-color-scheme. */

:root {
    color-scheme: light dark;

    --gray-50: hsl(220 20% 98%);
    --gray-100: hsl(220 16% 95%);
    --gray-200: hsl(220 14% 90%);
    --gray-300: hsl(220 12% 80%);
    --gray-500: hsl(220 9% 40%);
    --gray-600: hsl(220 10% 32%);
    --gray-800: hsl(220 15% 16%);
    --gray-900: hsl(220 20% 9%);

    --accent: hsl(340 85% 40%);
    --accent-hover: hsl(340 85% 33%);
    --accent-contrast: #fff;
    --alert: hsl(6 75% 40%);

    --bg: var(--gray-50);
    --bg-elevated: #fff;
    --bg-sunken: var(--gray-100);
    --border: var(--gray-300);
    --border-strong: hsl(220 9% 46%); /* form controls: >= 3:1 against the page (WCAG 1.4.11) */
    --text: var(--gray-900);
    --text-muted: var(--gray-600);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 12px;
    --container: 1180px;
    --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: hsl(220 25% 7%);
        --bg-elevated: hsl(220 20% 11%);
        --bg-sunken: hsl(220 22% 9%);
        --border: hsl(220 14% 22%);
        --border-strong: hsl(220 10% 55%);
        --text: hsl(220 20% 94%);
        --text-muted: hsl(220 10% 70%);
        --accent: hsl(340 100% 68%);
        --accent-hover: hsl(340 100% 75%);
        --accent-contrast: hsl(220 25% 7%);
        --alert: hsl(6 90% 68%);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }

.skip-link {
    position: absolute; left: 8px; top: -60px; z-index: 100;
    background: var(--accent); color: var(--accent-contrast); padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; min-height: var(--header-h); padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo:hover { color: var(--text); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.main-nav a:hover, .main-nav a[aria-current="page"] { background: var(--bg-sunken); }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .9rem; border: 1px solid var(--border, currentColor); }
.lang-switch a:hover { background: var(--bg-sunken); }
.site-search { display: flex; gap: 6px; margin-left: auto; flex: 1 1 260px; max-width: 420px; }
.site-search input { flex: 1; min-width: 0; }

/* Forms and buttons */
input, select, button { font: inherit; }
input[type="search"], input[type="date"], input[type="email"], input[type="text"], select {
    width: 100%; min-height: 44px; padding: 8px 12px; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px;
}
.site-search button, .btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
    border: 1px solid transparent; font-weight: 700; text-decoration: none; cursor: pointer; background: var(--bg-sunken); color: var(--text);
}
.btn-primary, .site-search button { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover, .site-search button:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg-sunken); color: var(--text); }

/* Breadcrumbs */
.breadcrumbs { padding-top: 16px; font-size: .875rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs li + li::before { content: "›"; margin-right: 8px; color: var(--text-muted); }
.breadcrumbs span { color: var(--text-muted); }

/* Page structure */
.hero { padding: 40px 0 8px; }
.hero .lead { max-width: 60ch; }
.page-head { padding: 24px 0 8px; }
.lead { font-size: 1.1rem; color: var(--text-muted); }
.block { margin: 32px 0; }
.empty { padding: 24px; background: var(--bg-sunken); border-radius: var(--radius); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chips-block { margin: 8px 0; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); text-decoration: none; font-weight: 600;
}
.chip:hover { background: var(--bg-sunken); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip__count { font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.chip.is-active .chip__count { color: inherit; }
.chips--small .chip { min-height: 44px; font-size: .9rem; }

/* Filters (native <details>, works without JavaScript) */
.filters { margin: 16px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); }
.filters > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; min-height: 44px; }
.filters__form { display: grid; gap: 12px; padding: 4px 16px 16px; }
.filters__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.field label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
@media (min-width: 900px) {
    @supports selector(::details-content) {
        .filters > summary { display: none; }
        .filters::details-content { content-visibility: visible; display: block; }
        .filters__form { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; padding-top: 16px; }
    }
}

/* Event cards */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.event-card { position: relative; display: flex; flex-direction: column; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.event-card:hover { border-color: var(--accent); }
.event-card__media { aspect-ratio: 16 / 9; background: var(--bg-sunken); }
.event-card__media { position: relative; }
.event-card__media img { width: 100%; height: 100%; object-fit: cover; }
/* Borrowed (Commons) photos are portraits more often than not: keep faces, which sit high, inside the 16:9 crop. */
.event-card__media img.is-photo, .event__media img.is-photo { object-position: 50% 25%; }
.event-card__credit {
    position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 2px 8px; border-top-left-radius: 6px;
    background: hsl(0 0% 0% / .62); color: #fff; font-size: .7rem; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Generated cover for events without an image (components/event-cover, App\Support\Media\EventCover): a colour per
   scene (or a hashed tone per venue), the title's initials, the date and the venue. Decorative (aria-hidden).
   Sizes follow the cover's own width (cqi) so the same markup works on a small card and on the event page. */
.event-cover {
    --cover-h: 340;
    --cover-l1: 38%;
    --cover-l2: 18%;
    position: relative; width: 100%; height: 100%; overflow: hidden; container-type: inline-size;
    color: #fff; text-shadow: 0 1px 2px hsl(0 0% 0% / .25);
    background:
        radial-gradient(circle at 88% 12%, hsl(var(--cover-h) 85% 62% / .45), transparent 55%),
        linear-gradient(135deg, hsl(var(--cover-h) 62% var(--cover-l1)), hsl(calc(var(--cover-h) + 35) 58% var(--cover-l2)));
}
.event-cover__date { position: absolute; top: 16px; top: 6cqi; left: 16px; left: 6cqi; display: flex; flex-direction: column; line-height: 1; }
.event-cover__day { font-size: 2rem; font-size: 12cqi; font-weight: 800; letter-spacing: -.02em; }
.event-cover__month { font-size: .8rem; font-size: 4.2cqi; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-top: .25em; }
.event-cover__mark {
    position: absolute; right: -2cqi; bottom: -6cqi;
    font-size: 7rem; font-size: 44cqi; font-weight: 900; line-height: 1; letter-spacing: -.05em;
    color: hsl(0 0% 100% / .22); text-shadow: none; white-space: nowrap;
}
.event-cover__caption {
    position: absolute; left: 16px; left: 6cqi; bottom: 14px; bottom: 5.5cqi; max-width: 70%;
    font-size: .95rem; font-size: 5.4cqi; font-weight: 800; line-height: 1.15; text-transform: uppercase; letter-spacing: .04em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-cover--scene-rock { --cover-h: 355; }
.event-cover--scene-flamenco-folk { --cover-h: 22; }
.event-cover--scene-classical { --cover-h: 45; --cover-l1: 33%; }
.event-cover--scene-indie-alt { --cover-h: 145; --cover-l1: 32%; }
.event-cover--scene-electronic { --cover-h: 188; --cover-l1: 34%; }
.event-cover--scene-jazz-blues { --cover-h: 215; }
.event-cover--scene-metal-punk { --cover-h: 255; --cover-l2: 12%; }
.event-cover--scene-urbano-latin { --cover-h: 290; }
.event-cover--scene-pop { --cover-h: 322; }
.event-cover--tone-0 { --cover-h: 10; }
.event-cover--tone-1 { --cover-h: 35; --cover-l1: 34%; }
.event-cover--tone-2 { --cover-h: 160; --cover-l1: 30%; }
.event-cover--tone-3 { --cover-h: 195; --cover-l1: 33%; }
.event-cover--tone-4 { --cover-h: 225; }
.event-cover--tone-5 { --cover-h: 250; }
.event-cover--tone-6 { --cover-h: 280; }
.event-cover--tone-7 { --cover-h: 310; }
@media (prefers-color-scheme: dark) {
    /* Same hues, deeper: a bright block would glare on the dark page. */
    .event-cover { --cover-l1: 28%; --cover-l2: 12%; }
}
.event-card__body { padding: 12px 14px 16px; }
.event-card__date { font-size: .85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.event-card__title { margin: 0 0 4px; }
.event-card__link { color: var(--text); text-decoration: none; }
.event-card__link::after { content: ""; position: absolute; inset: 0; }
.event-card__link:focus-visible { outline: none; }
.event-card:has(.event-card__link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.event-card__venue { margin: 0; color: var(--text-muted); font-size: .9rem; }
.event-card--featured { flex-direction: row; }
.event-card--featured .event-card__media { flex: 1 1 55%; aspect-ratio: auto; min-height: 220px; }
.event-card--featured .event-card__body { flex: 1 1 45%; align-self: center; padding: 20px; }
.event-card--featured .event-card__title { font-size: 1.5rem; }
@media (max-width: 700px) {
    .event-card--featured { flex-direction: column; }
    .event-card--featured .event-card__media { aspect-ratio: 16 / 9; min-height: 0; }
}

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--border); font-size: .75rem; font-weight: 700; color: var(--text); }
.badge--alert { color: var(--alert); border-color: var(--alert); }

/* Event page */
.event { padding-top: 16px; padding-bottom: 32px; }
.event__head { display: grid; gap: 24px; margin-bottom: 24px; }
.event__media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-sunken); }
.event__media img { width: 100%; height: 100%; object-fit: cover; }
.event__figure { margin: 0; min-width: 0; }
.event__credit { margin: 6px 0 0; overflow-wrap: anywhere; }
.event__when { font-size: 1.15rem; font-weight: 700; }
.event__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--bg-sunken); border-left: 4px solid var(--border); }
.notice--alert { border-left-color: var(--alert); }
.detail-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.detail-card { padding: 16px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); }
@media (min-width: 900px) {
    .event__head { grid-template-columns: 1.2fr 1fr; align-items: center; }
}

.link-list { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }

.search-page { display: grid; gap: 8px; max-width: 520px; }
.search-page label { font-weight: 600; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; }
.pagination__item { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-weight: 600; }
.pagination__item.is-disabled { color: var(--text-muted); opacity: .6; }

/* Footer */
.site-footer { margin-top: 56px; padding: 32px 0 24px; background: var(--bg-sunken); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-brand { font-weight: 800; font-size: 1.15rem; margin-bottom: 4px; }
.footer-title { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.site-footer li { padding: 3px 0; }
.footer-legal { margin-top: 24px; font-size: .85rem; }

@media (prefers-reduced-motion: no-preference) {
    .event-card, .chip, .btn { transition: border-color .15s, background-color .15s; }
}

/* Keep the first concerts above the fold on phones: chips scroll sideways instead of wrapping. */
@media (max-width: 640px) {
    .chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: -16px;
        padding-inline: 16px;
        scrollbar-width: none;
    }
    .chips .chip { white-space: nowrap; }
}
.legal { max-width: 760px; } .legal h2 { margin-top: 28px; } .legal ul { padding-left: 20px; }

.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.link-list li { padding: 0; }
.link-list a { display: inline-flex; align-items: center; min-height: 44px; }

.venue-address { font-style: normal; }
.sticky-cta { display: none; }
@media (max-width: 767px) {
    .sticky-cta {
        display: block; position: sticky; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: var(--bg-elevated); border-top: 1px solid var(--border);
    }
    .sticky-cta .btn { width: 100%; justify-content: center; text-align: center; }
}

.newsletter-form { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.newsletter-form__fields { display: grid; gap: 12px; max-width: 520px; }
.newsletter-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check { min-height: 44px; display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }

/* Related concerts: a sideways rail on phones keeps the event page short. */
@media (max-width: 640px) {
    .card-rail {
        grid-auto-flow: column;
        grid-auto-columns: 75%;
        grid-template-columns: none;
        overflow-x: auto;
        margin-inline: -16px;
        padding-inline: 16px;
        scroll-snap-type: x proximity;
    }
    .card-rail > * { scroll-snap-align: start; }
}
.field--check label { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; }
.active-filters { margin: 8px 0; }

/* Month calendar: a real table on wide screens, a plain day list on phones (empty days are hidden). */
.calendar-nav { display: flex; justify-content: space-between; gap: 8px; margin: 12px 0; }
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 24px; }
.calendar caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
.calendar th, .calendar td { border: 1px solid var(--border); padding: 6px; vertical-align: top; }
.calendar th { background: var(--bg-elevated); font-size: .8125rem; }
.calendar td { height: 96px; font-size: .8125rem; }
.calendar__out { background: var(--bg-elevated); }
.calendar__day { margin: 0 0 4px; font-weight: 700; }
.calendar__weekday { display: none; }
.calendar__events { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.calendar__time { font-weight: 700; margin-right: 4px; }
@media (max-width: 719px) {
    .calendar, .calendar tbody, .calendar tr, .calendar td { display: block; width: 100%; }
    .calendar thead, .calendar td.calendar__out, .calendar td.calendar__empty { display: none; }
    .calendar caption { display: block; width: 100%; }
    .calendar td { height: auto; border-width: 0 0 1px; font-size: .9375rem; }
    .calendar__weekday { display: inline; text-transform: capitalize; }
}
