/* CSS/border-benefit.css
 *
 * Styles for /grensvoordeel. Leans on the site's existing custom properties
 * (colors.css) so the page inherits the brand rather than restating it.
 */

.benefit-main {
    max-width: 1100px;
    /* The site header is position:fixed, so the page has to clear it itself.
     * 6.5em matches .city-container, keeping the two landing pages aligned. */
    margin: 6.5em auto 0;
    padding: 1rem 1rem 3rem;
    font-family: var(--font-family-body);
    color: var(--color-text);
}

.benefit-hero h1 {
    font-family: var(--font-family-title);
    font-weight: var(--font-weight-title);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 0.5rem;
}

.benefit-lead {
    max-width: 62ch;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0 0 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Controls                                                            */
/* ------------------------------------------------------------------ */

.benefit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: flex-end;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.benefit-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.benefit-control label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--color-muted);
}

.benefit-control select,
.benefit-control input[type="number"] {
    font: inherit;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    min-width: 6rem;
}

.benefit-control select:focus-visible,
.benefit-control input:focus-visible,
.benefit-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.benefit-input-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.benefit-unit {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.benefit-control-actions {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.benefit-btn {
    font: inherit;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}

.benefit-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-700);
}

.benefit-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--color-text);
    cursor: pointer;
}

.benefit-toggle input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
}

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

.benefit-map-shell {
    position: relative;
    z-index: 0;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

#benefit-map {
    width: 100%;
    height: min(72vh, 680px);
    background: #eae7e1;
}

/* The surface must never intercept clicks — the map still owns interaction. */
.benefit-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.benefit-status {
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(var(--rgb-white), 0.94);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
}

.benefit-status.is-error {
    border-color: #c8384b;
    color: #8f2233;
}

/* ------------------------------------------------------------------ */
/* Ad slot                                                             */
/* ------------------------------------------------------------------ */

.benefit-ad-section {
    margin: 1.25rem 0 2rem;
}

.benefit-ad {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    height: 280px;
    min-height: 280px;
    max-height: 280px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    text-align: center;
}

.benefit-ad,
.benefit-ad * {
    box-sizing: border-box;
}

.benefit-ad-label {
    flex: 0 0 auto;
    margin-bottom: 0.45rem;
    color: var(--color-muted);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1;
}

.benefit-ad .adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-height: 250px;
}

/* ------------------------------------------------------------------ */
/* Readout                                                             */
/* ------------------------------------------------------------------ */

.benefit-readout {
    position: absolute;
    z-index: 600;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(22rem, calc(100% - 1.5rem));
    padding: 1rem 1.1rem;
    background: rgba(var(--rgb-white), 0.97);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
}

.benefit-readout[hidden] {
    display: none;
}

.benefit-readout-close {
    position: absolute;
    top: 0.35rem;
    right: 0.5rem;
    border: 0;
    background: none;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--color-muted);
    cursor: pointer;
}

.benefit-readout-place {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--color-muted);
    font-family: var(--font-family-mono);
}

.benefit-readout-headline {
    margin: 0 0 0.75rem;
    font-family: var(--font-family-title);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
}

.benefit-readout-headline.is-positive {
    color: #1c6b38;
}

.benefit-readout-headline.is-negative {
    color: #8f2233;
}

.benefit-readout-detail {
    margin: 0 0 0.75rem;
}

.benefit-readout-detail dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-muted);
    font-weight: 600;
    margin-top: 0.6rem;
}

.benefit-readout-detail dd {
    margin: 0.15rem 0 0;
}

.benefit-readout-detail a {
    color: var(--color-primary-700);
    font-weight: 600;
    text-decoration: none;
}

.benefit-readout-detail a:hover {
    text-decoration: underline;
}

.benefit-station-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--color-muted);
    margin-top: 0.1rem;
}

.benefit-readout-note {
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-muted);
    line-height: 1.45;
}

/* ------------------------------------------------------------------ */
/* Legend & caveats                                                    */
/* ------------------------------------------------------------------ */

.benefit-legend-block {
    margin-top: 2rem;
}

.benefit-legend-block h2 {
    font-family: var(--font-family-title);
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
}

.benefit-legend-intro {
    max-width: 68ch;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.benefit-legend {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.6rem 1.25rem;
}

.benefit-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.35;
}

.benefit-swatch {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
    border-radius: 4px;
    border: 1px solid rgba(var(--rgb-black), 0.15);
}

.benefit-legend-range {
    display: block;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.benefit-legend-bar {
    grid-column: 1 / -1;
    height: 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--rgb-black), 0.12);
}

.benefit-caveats {
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
}

.benefit-caveats h3 {
    font-family: var(--font-family-title);
    font-size: 1.05rem;
    margin: 0 0 0.6rem;
}

.benefit-caveats ul {
    margin: 0;
    padding-left: 1.1rem;
}

.benefit-caveats li {
    margin-bottom: 0.6rem;
    line-height: 1.55;
    max-width: 76ch;
}

.benefit-caveats li:last-child {
    margin-bottom: 0;
}

.benefit-updated {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ------------------------------------------------------------------ */
/* Small screens                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 640px) {
    #benefit-map {
        height: 65vh;
    }

    .benefit-controls {
        gap: 0.75rem 1rem;
    }

    .benefit-control {
        flex: 1 1 8rem;
    }

    .benefit-control-actions {
        flex: 1 1 100%;
        justify-content: space-between;
    }

    .benefit-ad-section {
        margin: 1rem 0 1.5rem;
    }

    .benefit-ad {
        height: 180px;
        min-height: 180px;
        max-height: 180px;
        padding: 0.5rem;
    }

    .benefit-ad .adsbygoogle {
        min-height: 160px;
    }

    /* On a phone the floating card would cover the map it describes. */
    .benefit-readout {
        position: static;
        width: auto;
        margin: 0;
        border-radius: 0;
        border-width: 1px 0 0;
        box-shadow: none;
    }
}
