/**
 * PSU calculator (NL) - /voeding-calculator/
 * Colours come from theme-vars.css only. Mobile first, tested down to 360px.
 */

.vc-page {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: clamp(1rem, 3vw, 1.5rem) 0 clamp(3rem, 6vw, 5rem);
}

.vc-container {
    /* Same content width as the guides and the other tools (1040px). */
    max-width: 65rem;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
}

.vc-header {
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.vc-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.vc-intro {
    max-width: 75ch;
    color: var(--text-secondary);
    font-size: clamp(0.9375rem, 1.2vw + 0.25rem, 1rem);
    line-height: 1.65;
    margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
}

/* ---------- Tool ---------- */

.vc-tool {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: clamp(2rem, 5vw, 3rem);
}

.vc-tool__title {
    font-size: 1.125rem;
    margin: 0 0 1rem;
}

.vc-form {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.vc-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.vc-field label,
.vc-field legend {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0;
}

.vc-field select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font: inherit;
}

.vc-submit {
    justify-self: start;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--text-on-fill);
    border: 0;
    border-radius: var(--radius-md);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.vc-submit:hover {
    background: var(--accent-hover);
}

/* ---------- Result ---------- */

.vc-result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.vc-result__headline {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.5rem;
}

.vc-result__detail {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.vc-result__error {
    color: var(--signal-block);
    margin: 0.75rem 0 0;
}

.vc-result__error[x-cloak] {
    display: none;
}

.vc-notice {
    color: var(--text-secondary);
}


/* ---------- Optional inputs ---------- */

.vc-more summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.vc-field select:focus-visible,
.vc-submit:focus-visible,
.vc-table-wrap:focus-visible,
.vc-faq__item summary:focus-visible,
.vc-more summary:focus-visible,
.vc-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.vc-more__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    padding-top: 0.5rem;
}

/* ---------- Figures and actions ---------- */

.vc-figures {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 1rem;
}

.vc-figure {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

.vc-figure--main {
    border-color: var(--accent);
}

.vc-figure dt {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.vc-figure dd {
    margin: 0.25rem 0 0;
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
}

.vc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.vc-button {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--text-on-fill);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
}

.vc-button:hover {
    background: var(--accent-hover);
}

.vc-button--ghost {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.vc-button--ghost:hover {
    background: var(--bg-hover);
}

/* ---------- Tables ---------- */

.vc-table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.vc-table {
    width: 100%;
    min-width: 20rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.vc-table__caption {
    padding: 0.625rem 0.75rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.vc-table th,
.vc-table td {
    padding: 0.625rem 0.75rem;
    text-align: left;
    border-top: 1px solid var(--border);
}

.vc-table thead th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.vc-table tr.is-selected {
    background: var(--bg-hover);
}

/* ---------- Article ---------- */

.vc-article {
    line-height: 1.65;
}

/* Keep running text readable now that the column is wider. */
.vc-article p,
.vc-article ul,
.vc-article ol {
    max-width: 75ch;
}

.vc-short blockquote {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
}

.vc-short h3 {
    margin: 0 0 0.5rem;
    font-size: 1.0625rem;
}

.vc-short p,
.vc-short ul {
    margin: 0 0 0.75rem;
}

.vc-short ul {
    padding-left: 1.25rem;
}

.vc-toc {
    margin-bottom: 2rem;
}

.vc-toc__title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.vc-toc ol {
    margin: 0;
    padding-left: 1.25rem;
}

.vc-section {
    margin-bottom: 2rem;
    scroll-margin-top: calc(var(--header-h, 4rem) + 1rem);
}

.vc-section h2 {
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    line-height: 1.25;
    margin: 0 0 0.75rem;
}

.vc-section p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.vc-section a,
.vc-toc a,
.vc-short a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* ---------- FAQ ---------- */

.vc-faq__item {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.vc-faq__item summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.vc-faq__item p {
    margin: 0.5rem 0 0;
}

@media (min-width: 40rem) {
    .vc-form {
        grid-template-columns: 1fr 1fr;
    }

    .vc-more,
    .vc-submit {
        grid-column: 1 / -1;
    }

    .vc-more__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vc-page * {
        transition: none !important;
        animation: none !important;
    }
}
