/* Heritage Ecosystem — Header & Navigation (source — edit this) */
.site-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-logo { color: white; font-weight: bold; font-size: 1.2rem; white-space: nowrap; flex: 0 0 auto; }
/* Menu stays on the logo's line (including the Register button); it only wraps inside itself if the screen is very narrow */
.main-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: 1 1 auto; min-width: 0; }
.main-nav a { color: #ecf0f1; white-space: nowrap; }
.main-nav a:hover { color: white; text-decoration: none; }
.main-nav .btn-nav { color: #fff; padding: 0.25rem 0.8rem; font-size: 0.9rem; line-height: 1.4; }
.main-nav .btn-nav:hover { color: #fff; text-decoration: none; filter: brightness(1.1); }
@media (max-width: 640px) {
    .header-inner { padding: 0 0.75rem; gap: 0.4rem 0.75rem; }
    .main-nav { gap: 0.4rem 0.8rem; font-size: 0.92rem; }
}
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.town-selector-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
}
.user-menu { display: flex; align-items: center; gap: 0.75rem; color: #ecf0f1; }
.user-menu a { color: #ecf0f1; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--text);
}
#welcomeOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
}

#welcomeOverlay .overlay-content {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.25);
    max-width: 90%;
    width: 420px;
    text-align: center;
}

#closeWelcome {
    margin-top: 1rem;
    padding: 0.6rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}
#townList { list-style: none; margin-top: 1rem; }
#townList li { padding: 0.5rem; cursor: pointer; border-bottom: 1px solid var(--border); }
#townList li:hover { background: var(--bg); }
#townList li.active { background: #d4edda; font-weight: bold; }

/* Header links: underline on hover (like the logo); visible outline for keyboard users */
.main-nav a:hover { text-decoration: underline; }
.main-nav .btn-nav:hover { text-decoration: none; }
.main-nav a:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; border-radius: 2px; }

/* Name and language menu together on the left, apart from the page links (25 Nov) */
.header-brand { display: flex; align-items: center; gap: 0.75rem; flex: 0 0 auto; }
.site-lang { display: inline-flex; align-items: center; gap: 0.3rem; color: #ecf0f1; font-size: 0.9rem; margin: 0; cursor: pointer; }
.site-lang select { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: 4px; padding: 0.15rem 0.3rem; font-size: 0.9rem; cursor: pointer; }
.site-lang select option { color: #222; background: #fff; }
.site-lang select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
