* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;

    font-family: Arial, Helvetica, sans-serif;
    color: #111;
    background: #f4f4f4;
}


/* =========================================================
   Vast bedieningspaneel
   ========================================================= */

.vote-panel {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    padding: 10px 14px 9px;

    background: #fff;
    border-bottom: 1px solid #ccc;

    box-shadow:
        0 2px 7px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   Titel + VOL-logo
   ========================================================= */

.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;
}

.vote-title {
    flex: 1;
    min-width: 0;
}

.vote-title h1 {
    margin: 0 0 4px;

    font-size: 1.3rem;
    line-height: 1.2;
}

.vote-title p {
    margin: 0;

    font-size: 0.92rem;
    line-height: 1.3;
}

.vol-logo {
    display: block;

    width: 52px;
    height: 52px;

    object-fit: contain;

    flex-shrink: 0;
}


/* =========================================================
   Teller + opslaanknop
   ========================================================= */

.vote-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 7px 12px;

    margin-top: 9px;
}

.vote-count {
    flex: 1;

    min-width: 155px;

    font-size: 0.95rem;
    font-weight: bold;

    white-space: nowrap;
}


/* =========================================================
   Opslaanknop
   ========================================================= */

#save-button {
    border: 1px solid #222;
    border-radius: 6px;

    padding: 9px 13px;

    background: #222;
    color: #fff;

    font-family: inherit;
    font-size: 0.92rem;
    font-weight: bold;

    cursor: pointer;
}

#save-button:hover:not(:disabled) {
    background: #444;
}

#save-button:active:not(:disabled) {
    transform: translateY(1px);
}

#save-button:disabled {
    border-color: #ddd;

    background: #f2f2f2;
    color: #bbb;

    cursor: default;
}


/* =========================================================
   Meldingen
   ========================================================= */

.message {
    width: 100%;

    min-height: 1.15em;

    font-size: 0.86rem;
    line-height: 1.25;
    font-weight: bold;
}


/* =========================================================
   Gebouwenlijst
   ========================================================= */

.building-list {
    width: 100%;
    max-width: 700px;

    margin: 0 auto;
    padding: 14px;
}


/* =========================================================
   Gebouwkaart
   ========================================================= */

.building-card {
    position: relative;

    width: 100%;

    margin: 0 0 14px;

    overflow: hidden;

    background: #fff;

    border: 3px solid transparent;
    border-radius: 8px;

    cursor: pointer;

    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.building-card:last-child {
    margin-bottom: 0;
}

.building-card img {
    display: block;

    width: 100%;
    height: auto;

    margin: 0;
}


/* =========================================================
   Geselecteerde kaart
   ========================================================= */

.building-card.selected {
    border-color: #222;

    box-shadow:
        0 1px 5px rgba(0, 0, 0, 0.14);
}


/* =========================================================
   Vinkje
   ========================================================= */

.selected-mark {
    display: none;

    position: absolute;
    top: 9px;
    right: 9px;

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #fff;
    color: #111;

    font-size: 27px;
    line-height: 38px;
    font-weight: bold;
    text-align: center;

    box-shadow:
        0 1px 5px rgba(0, 0, 0, 0.35);
}

.building-card.selected .selected-mark {
    display: block;
}


/* =========================================================
   Toetsenbordfocus
   ========================================================= */

.building-card:focus-visible {
    outline: 3px solid #555;
    outline-offset: 2px;
}


/* =========================================================
   E-mail na eerste stem
   ========================================================= */

.email-panel {
    padding: 8px 14px 18px;
}

.email-box {
    max-width: 700px;

    margin: 0 auto;
    padding: 18px;

    background: #fff;

    border: 1px solid #ccc;
    border-radius: 8px;
}

.email-box h2 {
    margin: 0 0 14px;

    font-size: 1.05rem;
    line-height: 1.35;
}

.email-question {
    display: flex;

    gap: 10px;
}

.secondary-button,
#email-save {
    border: 1px solid #222;
    border-radius: 6px;

    padding: 9px 16px;

    background: #222;
    color: #fff;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: bold;

    cursor: pointer;
}

.secondary-button:hover,
#email-save:hover:not(:disabled) {
    background: #444;
}

#email-save:disabled {
    opacity: 0.5;
    cursor: default;
}

.email-form label {
    display: block;

    margin-bottom: 5px;

    font-size: 0.9rem;
    font-weight: bold;
}

#email-address {
    display: block;

    width: 100%;

    margin-bottom: 10px;
    padding: 10px 11px;

    border: 1px solid #aaa;
    border-radius: 5px;

    font-family: inherit;
    font-size: 1rem;
}

#email-address:focus {
    outline: 2px solid #555;
    outline-offset: 1px;
}

#email-address:disabled {
    background: #f2f2f2;
}

.email-message {
    min-height: 1.2em;

    margin-top: 10px;

    font-size: 0.88rem;
    font-weight: bold;
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    padding: 18px 12px 28px;

    text-align: center;

    font-size: 0.8rem;
    color: #666;
}


/* =========================================================
   Kleine smartphones
   ========================================================= */

@media (max-width: 420px) {

    .vote-panel {
        padding: 9px 11px 8px;
    }

    .vote-title h1 {
        font-size: 1.2rem;
    }

    .vote-title p {
        font-size: 0.85rem;
    }

    .vol-logo {
        width: 46px;
        height: 46px;
    }

    .vote-controls {
        margin-top: 8px;

        gap: 6px 8px;
    }

    .vote-count {
        min-width: 135px;

        font-size: 0.89rem;
    }

    #save-button {
        padding: 8px 10px;

        font-size: 0.86rem;
    }

    .message {
        font-size: 0.82rem;
    }

    .building-list {
        padding: 11px;
    }

    .building-card {
        margin-bottom: 11px;
    }

    .email-panel {
        padding: 6px 11px 16px;
    }

    .email-box {
        padding: 15px;
    }

    .email-box h2 {
        font-size: 1rem;
    }
}


/* =========================================================
   Tablet en desktop
   ========================================================= */

@media (min-width: 800px) {

    .vote-panel {
        padding-left:
            max(18px, calc((100% - 1000px) / 2));

        padding-right:
            max(18px, calc((100% - 1000px) / 2));
    }

    .building-list {
        max-width: 1000px;

        display: grid;

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 18px;

        padding: 18px;
    }

    .building-card {
        margin-bottom: 0;
    }

    .email-box {
        max-width: 964px;
    }

    .site-footer {
        clear: both;
    }
}
