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

:root {
    /* Scandinavian civic palette — deep forest + Falu-red on warm paper,
       instead of the generic blue/red SaaS default. */
    --bg:          #f7f2e7;
    --bg-elevated: #fffdf8;
    --bg-sunken:   #efe6d3;
    --ink:         #2b2620;
    --ink-soft:    #6b6255;
    --line:        #e1d5bb;
    --line-soft:   #ece2ca;

    --forest:      #1e3a2b;
    --forest-dark: #142a1f;
    --rust:        #a8482c;
    --rust-dark:   #832f1a;
    --gold:        #b1802c;
    --teal:        #35606f;
    --gray:        #8c8071;

    --font-display: 'Fraunces', ui-serif, Georgia, serif;
    --font-body:    'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-card: 0 1px 2px rgba(43,38,32,0.06), 0 6px 20px rgba(43,38,32,0.08);
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }

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

/* Top nav bar */
.navbar {
    background: var(--forest);
    background-image:
        radial-gradient(circle at 12% 30%, rgba(255,255,255,0.05) 0, transparent 45%),
        repeating-linear-gradient(115deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 26px);
    color: #f2ece0;
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--rust);
}
.navbar h1 {
    font-size: 1.2rem; font-weight: 600; letter-spacing: 0.01em;
}
.navbar a { color: inherit; }
.btn-primary {
    background: var(--rust);
    color: #fdf8ee;
    border: none;
    padding: 0.55rem 1.3rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 2px 0 var(--rust-dark);
    transition: transform 0.1s, box-shadow 0.1s;
}
.btn-primary:hover  { background: #b6512f; }
.btn-primary:active { transform: translateY(2px); box-shadow: none; }

/* Landing page hero — states both of the site's purposes (see what's
   planned/ongoing on the map, and reach the board) instead of the map
   being the only thing that reads as "the point" of the page and
   anmälan being a small link in the corner. Scoped to body.landing-page
   only (index.php), so the map's height still fills whatever's left of
   the viewport without a fragile hardcoded pixel offset. */
body.landing-page { display: flex; flex-direction: column; height: 100vh; margin: 0; }
body.landing-page #map { flex: 1; min-height: 0; height: auto; }

.landing-hero {
    background: var(--forest);
    background-image:
        radial-gradient(circle at 12% 30%, rgba(255,255,255,0.05) 0, transparent 45%),
        repeating-linear-gradient(115deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 26px);
    color: #f2ece0;
    padding: 1.5rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 1.25rem;
    border-bottom: 3px solid var(--rust);
}
.landing-hero-text { max-width: 640px; }
.landing-hero-tagline {
    font-family: var(--font-display); font-size: 2.1rem; font-weight: 600;
    color: #f2ece0; line-height: 1.15; margin-bottom: 0.65rem;
}
.landing-hero-desc { font-size: 0.92rem; color: #d9d2c4; line-height: 1.55; }

.btn-hero {
    display: flex; align-items: center; gap: 0.75rem;
    background: var(--rust); color: #fdf8ee; text-decoration: none;
    padding: 0.85rem 1.5rem; border-radius: 6px;
    box-shadow: 0 2px 0 var(--rust-dark);
    transition: transform 0.1s, box-shadow 0.1s;
    flex-shrink: 0;
}
.btn-hero:hover  { background: #b6512f; }
.btn-hero:active { transform: translateY(2px); box-shadow: none; }
.btn-hero-icon { font-size: 1.6rem; }
.btn-hero span:last-child { display: flex; flex-direction: column; font-weight: 700; font-size: 1.05rem; }
.btn-hero small { font-weight: 500; font-size: 0.75rem; opacity: 0.85; text-transform: none; letter-spacing: normal; }

@media (max-width: 700px) {
    .landing-hero { flex-direction: column; align-items: stretch; text-align: center; }
    .landing-hero-tagline { font-size: 1.6rem; }
    .btn-hero { justify-content: center; }
    .site-footer-col:last-child { text-align: left; }
}

/* Filter bar */
.filter-bar {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar span {
    font-size: 0.8rem; color: var(--ink-soft); margin-right: 0.25rem;
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}

.filter-btn {
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.15s;
}
.filter-btn.inactive { opacity: 0.35; }

/* Pin legend — explains what the teardrop markers on the map mean and
   that they're clickable, since that isn't otherwise obvious to a
   first-time visitor. */
.map-legend {
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--line);
    padding: 0.45rem 1.5rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.4;
}
.map-legend-icon { font-size: 0.95rem; flex-shrink: 0; }

/* Map */
#map { width: 100%; height: calc(100vh - 118px); }

/* Drawing toolbar (Terra Draw has no built-in UI, unlike the old DrawingManager) */
.draw-toolbar {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 5; width: min(90%, 420px);
    background: var(--bg-elevated); padding: 1rem 1.15rem; border-radius: 6px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
}
.draw-toolbar-title {
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 600; color: var(--forest); margin-bottom: 0.3rem;
}
.draw-toolbar-hint {
    font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; margin-bottom: 0.75rem;
}
.draw-toolbar-buttons { display: flex; gap: 0.5rem; }
.draw-toolbar-buttons button {
    flex: 1; border: 2px solid var(--line); background: var(--bg-elevated); color: var(--ink);
    padding: 0.55rem 0.9rem; border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.draw-toolbar-buttons button:hover  { background: var(--bg-sunken); }
.draw-toolbar-buttons button.active { background: var(--forest); border-color: var(--forest); color: #fdf8ee; }
.draw-toolbar > button {
    width: 100%; margin-top: 0.5rem;
    border: 2px solid var(--forest); background: var(--forest); color: #fdf8ee;
    padding: 0.5rem 0.9rem; border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.draw-toolbar > button:hover { background: var(--forest-dark); border-color: var(--forest-dark); }

.draw-toolbar-search-divider {
    text-align: center; font-size: 0.75rem; color: var(--ink-soft);
    margin: 0.75rem 0 0.5rem; text-transform: uppercase; letter-spacing: 0.06em;
    display: flex; align-items: center; gap: 0.6rem;
}
.draw-toolbar-search-divider::before, .draw-toolbar-search-divider::after {
    content: ''; flex: 1; border-top: 1px dashed var(--line);
}
.draw-toolbar-search-row { display: flex; gap: 0.5rem; align-items: center; }
.draw-toolbar-search-input {
    flex: 1; min-width: 0;
}
.draw-toolbar-search-row button {
    border: 2px solid var(--rust); background: var(--rust); color: #fdf8ee;
    padding: 0.5rem 0.9rem; border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.draw-toolbar-search-row button:hover:not(:disabled) { background: var(--rust-dark); border-color: var(--rust-dark); }
.draw-toolbar-search-row button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Info window */
.iw-title   { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: 4px; color: var(--forest); }
.iw-cat     { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.iw-desc    { font-size: 0.88rem; margin-bottom: 6px; }
.iw-planned { font-size: 0.82rem; color: var(--teal); font-style: italic; }
.iw-photos  { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.iw-photos img {
    width: 84px; height: 84px; object-fit: cover; border-radius: 3px;
    border: 1px solid var(--line);
}

/* Site footer — association contact/legal info, on every public page.
   Two columns side by side to keep it to two lines tall rather than
   stacking every fact on its own row. */
.site-footer {
    background: var(--forest-dark);
    color: #cfc6b4;
    padding: 0.6rem 1.5rem;
    font-size: 0.75rem;
    line-height: 1.45;
    border-top: 3px solid var(--rust);
    flex-shrink: 0;
}
.site-footer-inner {
    max-width: 900px; margin: 0 auto;
    display: flex; flex-wrap: wrap; justify-content: space-between;
    gap: 0.1rem 2rem;
}
.site-footer-col { flex: 1 1 260px; }
.site-footer-col:last-child { text-align: right; }
.site-footer strong { color: #f2ece0; }
.site-footer a { color: #e8c9ad; }

/* Responsive */
@media (max-width: 600px) {
    .navbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
