/* Freiheitliche Stammtische — look & feel aligned with libertaer-leben.de
   ("Ticket & Stamp": paper ground, ink text, one stamp colour, ticket-yellow
   stubs, display headlines, mono date lines). The site keeps its own logo. */

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 400 700;
    src: url("fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 500;
    src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-display: swap;
    font-weight: 600;
    src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

:root {
    --bg: #F5F6FA;
    --card: #FFFFFF;
    --ink: #17173A;
    --muted: #4C4E6B;
    --border: #DCDEEA;
    --primary: #3434D6;
    --primary-contrast: #FFFFFF;
    --primary-soft: #E4E4FB;
    --ticket: #FFD43B;
    --ticket-ink: #17173A;
    --stub-past: #E6E7EF;
    --marker-past: #9A9CB8;
    --header-bg: rgba(245, 246, 250, 0.92);
    --radius: 0.75rem;
    --radius-card: calc(var(--radius) * 1.66);
    --shadow-sm: 0 1px 2px rgba(23, 23, 58, 0.06), 0 1px 3px rgba(23, 23, 58, 0.08);
    --shadow-md: 0 6px 18px rgba(23, 23, 58, 0.12);
    --font-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
    --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --icon-moon: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
    --icon-sun: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
    --bg: #111127;
    --card: #1A1A38;
    --ink: #F1F2F8;
    --muted: #A6A8C8;
    --border: #2D2D56;
    --primary: #8A8AFF;
    --primary-contrast: #111127;
    --primary-soft: #26265A;
    --ticket: #FFD43B;
    --ticket-ink: #17173A;
    --stub-past: #26264A;
    --marker-past: #5C5E85;
    --header-bg: rgba(17, 17, 39, 0.92);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

[data-theme="dark"] {
    color-scheme: dark;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--primary);
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Header ---------- */

.site-header {
    position: relative;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0.6rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.site-logo {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    flex: none;
}

.site-title {
    margin: 0;
    line-height: 1.2;
    color: inherit;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    transition: background-color 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--ink);
    background: var(--primary-soft);
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-button {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--ink);
    border-radius: 999px;
    width: 2.4rem;
    height: 2.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}

.icon-button:hover {
    background: var(--primary-soft);
}

#theme-toggle::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: var(--icon-moon) no-repeat center / 18px 18px;
    mask: var(--icon-moon) no-repeat center / 18px 18px;
}

[data-theme="dark"] #theme-toggle::before {
    -webkit-mask-image: var(--icon-sun);
    mask-image: var(--icon-sun);
}

/* ---------- Layout ---------- */

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

#event-list-container {
    flex: 0 0 560px;
    overflow-y: auto;
    padding: 1rem 1.25rem 2rem;
    scrollbar-color: var(--border) transparent;
    scrollbar-width: thin;
}

#map-view-container {
    flex: 1;
    position: relative;
    background: var(--map-bg);
}

#map {
    width: 100%;
    height: 100%;
    background: var(--map-bg);
}

/* ---------- Filters ---------- */

.filter-bar {
    position: sticky;
    top: -1rem;
    z-index: 5;
    margin: -1rem -1.25rem 0.75rem;
    padding: 1rem 1.25rem 0.75rem;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 0.6rem 0 0.9rem;
    color: var(--muted);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-field input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    padding: 0.65rem 0;
}

.search-field input::-webkit-search-cancel-button {
    display: none;
}

.clear-button {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.4rem;
    border-radius: 999px;
}

.clear-button:hover {
    color: var(--ink);
}

.search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-row .search-field {
    flex: 1;
    min-width: 0;
}

.search-row .segmented {
    flex: none;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.state-chip {
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-contrast);
    background: var(--primary);
    border: 0;
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
}

.state-chip[hidden] {
    display: none;
}

.state-chip:hover {
    filter: brightness(1.1);
}

/* Segmented control (Kommende | Alle, Liste | Karte). */
.segmented {
    display: inline-flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.segmented button {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.segmented button:hover {
    color: var(--ink);
}

.segmented button[aria-selected="true"] {
    background: var(--primary);
    color: var(--primary-contrast);
}

.result-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.source-status {
    margin: 0 0 0.75rem;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1rem 0.25rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- List ---------- */

.month-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 1.25rem 0 0.6rem 0.25rem;
}

.month-label:first-child {
    margin-top: 0.25rem;
}

.list-separator {
    display: flex;
    align-items: center;
    margin: 1.75rem 0 0.5rem;
    color: var(--primary);
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.list-separator::before,
.list-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.list-separator span {
    padding: 0 0.8rem;
}

/* The ticket: body on the left, perforated stub on the right. */
.ticket {
    position: relative;
    display: flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ticket:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.ticket.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-md);
}

.ticket.past-event {
    opacity: 0.7;
}

.ticket-body {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 1rem 0.9rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ticket-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--ink);
}

.ticket-desc {
    margin: 0.1rem 0 0;
    font-size: 0.86rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-details {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border);
    cursor: auto;
}

.ticket.expanded .ticket-details {
    display: flex;
}

.ticket.expanded .ticket-desc {
    -webkit-line-clamp: unset;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.6rem 0.15rem 0.2rem;
    max-width: 100%;
}

.chip:not(.chip-orga) {
    padding-left: 0.6rem;
}

.chip img {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    object-fit: contain;
    flex: none;
}

.ticket-stub {
    flex: 0 0 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.4rem;
    background: var(--ticket);
    color: var(--ticket-ink);
    border-left: 2px dashed rgba(23, 23, 58, 0.25);
    position: relative;
    text-align: center;
}

/* Perforation notches at both ends of the tear line. */
.ticket-stub::before,
.ticket-stub::after {
    content: "";
    position: absolute;
    left: -8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
}

.ticket-stub::before {
    top: -8px;
}

.ticket-stub::after {
    bottom: -8px;
}

.ticket-stub.past {
    background: var(--stub-past);
    color: var(--muted);
    border-left-color: var(--border);
}

.stub-dow {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stub-day {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.stub-month {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.stub-rel {
    margin-top: 0.3rem;
    font-size: 0.68rem;
    opacity: 0.8;
}

.no-results {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
    background: var(--card);
    border-radius: var(--radius-card);
    border: 2px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.no-results svg {
    opacity: 0.6;
    color: var(--primary);
}

.no-results p {
    margin: 0;
    font-weight: 500;
}

/* ---------- Newsletter ---------- */

.newsletter-card {
    position: relative;
    margin: 0.5rem 0 1.5rem;
    padding: 1.3rem 1.25rem 0.9rem;
    border-radius: var(--radius-card);
    background: var(--nl-bg);
    color: #FFFFFF;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.newsletter-card[hidden] {
    display: none;
}

/* A faint oversized envelope line drawing behind the pitch. */
.newsletter-card::before {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -50px;
    width: 220px;
    height: 220px;
    opacity: 0.08;
    background: no-repeat center / contain url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
    pointer-events: none;
}

.newsletter-card-head {
    position: relative;
}

.newsletter-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ticket);
}

.newsletter-card-title {
    margin: 0.3rem 0 0.35rem;
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.15;
    color: #FFFFFF;
}

.newsletter-card-text {
    margin: 0;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.86);
}

.newsletter-card .newsletter-embed {
    position: relative;
    margin-top: 0.9rem;
}

.newsletter-embed {
    border-radius: var(--radius-card);
    overflow: hidden;
}

.newsletter-embed iframe {
    display: block;
}

.list-footer {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.list-footer a {
    color: var(--muted);
}

.list-footer a:hover {
    color: var(--ink);
}

/* ---------- Map ---------- */

.leaflet-container {
    font-family: var(--font-sans);
    background: var(--map-bg);
}

/* Poster map: Germany as one solid silhouette with hairline state borders,
   Termine as white dots in a soft halo (the look of the original site). */
:root {
    --map-bg: var(--bg); /* seamless with the list column */
    --nl-bg: #3434D6;
    --map-land: #111114;
    --map-border: rgba(255, 255, 255, 0.42);
    --map-land-hover: #2A2A33;
    --map-land-dimmed: #B9BAC4;
    --marker-dot: #FFFFFF;
    --marker-halo: rgba(255, 255, 255, 0.2);
    --marker-dot-past: #8A8A92;
    --marker-halo-past: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] {
    --map-bg: #111127;
    --nl-bg: #2A2AA8;
    --map-land: #262648;
    --map-border: rgba(17, 17, 39, 0.75);
    --map-land-hover: #33335C;
    --map-land-dimmed: #1A1A36;
    --marker-halo: rgba(255, 255, 255, 0.16);
    --marker-dot-past: #6E7096;
    --marker-halo-past: rgba(255, 255, 255, 0.07);
}

.leaflet-interactive.de-land,
path.de-land {
    fill: var(--map-land);
    fill-opacity: 1;
    stroke: var(--map-border);
    stroke-width: 0.8px;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill 0.15s;
}

path.de-land:hover {
    fill: var(--map-land-hover);
}

path.de-land.dimmed {
    fill: var(--map-land-dimmed);
}

path.de-land.dimmed:hover {
    fill: var(--map-land-hover);
}

path.fs-marker {
    fill: var(--marker-dot);
    transition: fill 0.12s;
}

path.fs-halo {
    fill: var(--marker-halo);
}

path.fs-marker.past {
    fill: var(--marker-dot-past);
}

path.fs-halo.past {
    fill: var(--marker-halo-past);
}

path.fs-marker.hover {
    fill: var(--ticket);
}

path.fs-halo.hover {
    fill: color-mix(in srgb, var(--ticket) 45%, transparent);
}

.leaflet-control-zoom {
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    overflow: hidden;
    box-shadow: var(--shadow-sm) !important;
}

.leaflet-control-zoom a {
    background: var(--card) !important;
    color: var(--ink) !important;
    border-bottom-color: var(--border) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
}

.leaflet-control-zoom a:hover {
    background: var(--primary-soft) !important;
}

.leaflet-control-attribution {
    background: var(--header-bg) !important;
    color: var(--muted) !important;
    font-size: 10px !important;
    border-top-left-radius: 8px;
}

.leaflet-control-attribution a {
    color: var(--muted) !important;
}

.fs-tooltip {
    background: var(--ink);
    color: var(--bg);
    border: 0;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.fs-tooltip::before {
    display: none;
}

.fs-popup .leaflet-popup-content-wrapper {
    background: var(--card);
    color: var(--ink);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 0;
}

.fs-popup .leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.popup-desc {
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-group {
    border-top: 1px solid var(--border);
    padding: 0.4rem 0.5rem 0.4rem;
}

.popup-group-label {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.2rem 0.4rem 0.3rem;
}

.popup-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    font: inherit;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-radius: 10px;
    padding: 0.4rem 0.4rem;
    cursor: pointer;
}

.popup-row:hover {
    background: var(--primary-soft);
}

.popup-row.past {
    color: var(--muted);
}

.popup-row-date {
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--ticket);
    color: var(--ticket-ink);
    border-radius: 6px;
    padding: 0.15rem 0.4rem;
    white-space: nowrap;
}

.popup-row.past .popup-row-date {
    background: var(--stub-past);
    color: var(--muted);
}

.popup-row-title {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popup-row-chevron {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
}

.fs-popup .leaflet-popup-tip {
    background: var(--card);
    border: 1px solid var(--border);
}

.fs-popup .leaflet-popup-close-button {
    color: var(--muted) !important;
    font-size: 20px !important;
    padding: 6px 8px 0 0 !important;
}

.popup {
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    overflow-y: auto;
}

.popup-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.popup-item:last-of-type {
    border-bottom: 0;
}

.popup-item.past {
    opacity: 0.65;
}

.popup-stub {
    flex: none;
    width: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    background: var(--ticket);
    color: var(--ticket-ink);
    border-radius: 10px;
    padding: 0.4rem 0.2rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    align-self: flex-start;
}

.popup-item.past .popup-stub {
    background: var(--stub-past);
    color: var(--muted);
}

.popup-stub strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.popup-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.popup-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.popup-host {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.popup-host img {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
}

.popup-host a {
    color: inherit;
}

.popup-orga {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.popup-orga img {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    object-fit: contain;
}

.popup-orga a {
    color: var(--muted);
}

.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink) !important;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    transition: background-color 0.15s;
}

.btn:hover {
    background: var(--primary-soft);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-contrast) !important;
}

.btn-primary:hover {
    background: var(--primary);
    filter: brightness(1.1);
}

.popup-qr {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--muted);
    max-width: 100%;
}

.popup-qr img {
    width: 132px;
    height: 132px;
    padding: 6px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.popup-qr span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
    text-decoration: underline;
}

.popup-more {
    padding: 0.5rem 0.9rem 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Info page ---------- */

body.page {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

.about-container {
    max-width: 760px;
    width: 100%;
    margin: 2rem auto 4rem;
    padding: 0 1.25rem;
}

.about-container h1 {
    font-size: 2.2rem;
    margin: 0.5rem 0 1.5rem;
}

.about-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.about-section h2 {
    font-size: 1.3rem;
    margin: 0 0 0.75rem;
}

.about-section p {
    margin: 0 0 0.75rem;
    line-height: 1.65;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section a {
    color: var(--primary);
}

/* ---------- Responsive ---------- */

/* Floating list/map switch: mobile only. */
.view-switch {
    display: none;
    position: fixed;
    left: 50%;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 1200;
    box-shadow: var(--shadow-md);
}

.view-switch button {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
}

@media (max-width: 1100px) {
    .main-container {
        flex-direction: column;
    }

    #event-list-container {
        flex: 1;
        width: 100%;
        padding-bottom: 5rem;
    }

    #map-view-container {
        display: none;
        flex: 1;
        width: 100%;
        border-left: 0;
    }

    body.view-map #event-list-container {
        display: none;
    }

    body.view-map #map-view-container {
        display: block;
    }

    .view-switch {
        display: inline-flex;
    }

    .leaflet-bottom.leaflet-right {
        bottom: 3.5rem;
    }

    .leaflet-bottom.leaflet-left {
        bottom: 0;
    }
}

@media (max-width: 640px) {
    .header-container {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .site-title {
        font-size: 1rem;
    }

    .header-nav {
        margin-left: 0;
    }

    .nav-link {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    #event-list-container {
        padding: 0.75rem 0.75rem 2rem;
    }

    .filter-bar {
        margin: -0.75rem -0.75rem 0.75rem;
        padding: 0.75rem 0.75rem 0.6rem;
        top: -0.75rem;
    }

    .ticket-title {
        font-size: 1rem;
    }

    .ticket-stub {
        flex-basis: 74px;
    }

    .stub-day {
        font-size: 1.6rem;
    }

    #map-view-container {
        flex-basis: 38vh;
    }
}

@media (max-width: 420px) {
    .site-title {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticket,
    .ticket:hover {
        transition: none;
        transform: none;
    }
}
