/* ============================================================
   REKENPUNT — Sitewide design system + calculator styling.
   Loaded on EVERY page on the front-end (not just calc pages).
   Designed to override Twenty Twenty-Five defaults sufficiently
   to make the site feel branded. Keeps theme structure intact.
   Color palette: groen, geinspireerd door blitzrechner-architectuur.
   ============================================================ */

:root {
    --rp-primary: #0f5132;        /* donkergroen — header, tekst-accent */
    --rp-primary-2: #198754;      /* helder groen — knoppen, results */
    --rp-primary-soft: #d1e7dd;   /* zacht groen — result block bg */
    --rp-accent: #fd7e14;         /* warme oranje — highlights, CTA */
    --rp-bg: #ffffff;
    --rp-bg-alt: #f8faf9;         /* subtiele off-white voor kaarten */
    --rp-card: #ffffff;
    --rp-border: #e3e8ef;
    --rp-text: #1a1f2c;
    --rp-muted: #5b6478;
    --rp-radius: 12px;
    --rp-shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 16px rgba(15,81,50,.06);
}

/* ============================================================
   SITEWIDE LAYOUT TWEAKS — works on Twenty Twenty-Five
   We hide the theme's default header/footer template parts and
   render our own (rp-site-header / rp-site-footer) so we get
   consistent branding across themes.
   ============================================================ */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* (Theme template-parts kept; their styling is overridden via specific selectors below.) */

/* Branded link color sitewide */
.wp-site-blocks a:not(.rp-btn):not(.rp-tool-card):not(.rp-related a):not(.rp-share a):not(.rp-breadcrumb a):not(.wp-block-site-title a) {
    color: var(--rp-primary-2);
}
.wp-site-blocks h1, .wp-site-blocks h2, .wp-site-blocks h3 {
    color: var(--rp-primary);
}
/* Branded site title in theme header */
.wp-block-site-title a, .wp-block-site-title a:visited {
    color: var(--rp-primary) !important;
    font-weight: 700;
}
/* Branded primary navigation items */
.wp-block-navigation a {
    color: var(--rp-text);
    font-weight: 500;
}
.wp-block-navigation a:hover {
    color: var(--rp-primary-2);
}

/* Optional: brand-color block-buttons used in patterns */
.wp-block-button.is-style-rp .wp-block-button__link {
    background: var(--rp-primary-2) !important;
    color: #fff !important;
    border-radius: 8px !important;
}

/* ============================================================
   HOMEPAGE BLOCKS (used in homepage Gutenberg patterns)
   ============================================================ */

.rp-hero {
    background: linear-gradient(135deg, #f1f8f4 0%, #ffffff 100%);
    border-bottom: 1px solid var(--rp-border);
    padding: 3.5rem 1.5rem;
    text-align: center;
}
.rp-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 0.75rem;
    color: var(--rp-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.rp-hero p {
    font-size: 1.15rem;
    color: var(--rp-muted);
    margin: 0 auto;
    max-width: 700px;
}
.rp-hero-cta {
    margin-top: 1.75rem;
    display: inline-flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}
.rp-btn {
    display: inline-block;
    background: var(--rp-primary-2);
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--rp-primary-2);
    transition: background .15s;
}
.rp-btn:hover {
    background: var(--rp-primary);
}
.rp-btn-secondary {
    background: transparent;
    color: var(--rp-primary);
    border-color: var(--rp-border);
}
.rp-btn-secondary:hover {
    background: var(--rp-bg-alt);
    color: var(--rp-primary);
}

.rp-trust-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    background: var(--rp-bg-alt);
    border-bottom: 1px solid var(--rp-border);
    font-size: 0.9rem;
    color: var(--rp-muted);
}
.rp-trust-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.rp-trust-strip span::before {
    content: "✓";
    color: var(--rp-primary-2);
    font-weight: 700;
}

.rp-section {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.rp-section h2 {
    font-size: 1.75rem;
    margin: 0 0 1.5rem;
    color: var(--rp-primary);
}

.rp-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.rp-tool-card {
    display: block;
    padding: 1.5rem;
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    text-decoration: none;
    color: var(--rp-text);
    transition: transform .15s, box-shadow .15s, border-color .15s;
    position: relative;
}
.rp-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--rp-shadow);
    border-color: var(--rp-primary-2);
}
.rp-tool-card .rp-tool-icon {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    display: block;
}
.rp-tool-card h3 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
    color: var(--rp-primary);
}
.rp-tool-card p {
    margin: 0;
    color: var(--rp-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.rp-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.rp-category {
    padding: 1.5rem;
    background: var(--rp-bg-alt);
    border-radius: var(--rp-radius);
    border-left: 4px solid var(--rp-primary-2);
}
.rp-category h3 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: var(--rp-primary);
}
.rp-category ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rp-category li {
    margin: 0.25rem 0;
}
.rp-category a {
    color: var(--rp-text);
    text-decoration: none;
    font-size: 0.92rem;
}
.rp-category a:hover {
    color: var(--rp-primary-2);
    text-decoration: underline;
}

/* ============================================================
   BLOG / ARCHIVE
   ============================================================ */
.rp-blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.rp-blog-card {
    padding: 1.5rem;
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
}
.rp-blog-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}
.rp-blog-card h3 a {
    color: var(--rp-text);
    text-decoration: none;
}
.rp-blog-card h3 a:hover {
    color: var(--rp-primary-2);
}
.rp-blog-card .rp-meta {
    font-size: 0.8rem;
    color: var(--rp-muted);
    margin-bottom: 0.5rem;
}

/* ============================================================
   CALCULATOR PAGE — the heart of the site
   ============================================================ */

.rp-calc-wrap {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.rp-breadcrumb {
    font-size: 0.85rem;
    color: var(--rp-muted);
    padding: 1rem 0 0.5rem;
}
.rp-breadcrumb a {
    color: var(--rp-muted);
    text-decoration: none;
}
.rp-breadcrumb a:hover {
    color: var(--rp-primary-2);
    text-decoration: underline;
}
.rp-breadcrumb .sep {
    margin: 0 0.4rem;
    color: var(--rp-border);
}

.rp-page-meta {
    font-size: 0.8rem;
    color: var(--rp-muted);
    margin-bottom: 1rem;
}

.rp-toc {
    background: var(--rp-bg-alt);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.rp-toc summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--rp-primary);
    font-size: 0.95rem;
}
.rp-toc ol {
    margin: 0.75rem 0 0 1.25rem;
    padding: 0;
    color: var(--rp-text);
    font-size: 0.95rem;
}
.rp-toc li {
    margin: 0.3rem 0;
}
.rp-toc a {
    color: var(--rp-text);
    text-decoration: none;
}
.rp-toc a:hover {
    color: var(--rp-primary-2);
    text-decoration: underline;
}

.rp-calc {
    margin: 1.5rem 0;
    font-family: inherit;
    color: var(--rp-text);
    line-height: 1.55;
}

.rp-intro {
    color: var(--rp-muted);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.rp-form {
    background: var(--rp-bg-alt);
    border: 1px solid var(--rp-border);
    border-radius: var(--rp-radius);
    padding: 1.5rem;
}

.rp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.rp-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--rp-text);
}

.rp-input-wrap {
    position: relative;
}

.rp-field input,
.rp-field select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--rp-bg);
    border: 1px solid var(--rp-border);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--rp-text);
    box-sizing: border-box;
}

.rp-field input:focus,
.rp-field select:focus {
    outline: 2px solid var(--rp-primary-2);
    outline-offset: 1px;
    border-color: transparent;
}

.rp-unit {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--rp-muted);
    pointer-events: none;
}

.rp-result {
    margin-top: 1rem;
}

.rp-result-inner {
    background: var(--rp-primary-soft);
    border: 1px solid var(--rp-primary-2);
    border-radius: var(--rp-radius);
    padding: 1.5rem;
}

.rp-result-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rp-primary);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.rp-result-primary {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rp-primary);
    line-height: 1.2;
}

.rp-result-secondary {
    font-size: 0.95rem;
    color: var(--rp-text);
    margin-top: 0.35rem;
}

.rp-result-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rp-result-table tr {
    border-top: 1px solid rgba(15,81,50,.15);
}

.rp-result-table tr:first-child {
    border-top: none;
}

.rp-cell-key {
    padding: 0.5rem 0.5rem 0.5rem 0;
    color: var(--rp-text);
}

.rp-cell-val {
    padding: 0.5rem 0 0.5rem 0.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--rp-primary);
    font-variant-numeric: tabular-nums;
}

.rp-steps {
    margin-top: 1rem;
    border-top: 1px dashed rgba(15,81,50,.25);
    padding-top: 0.85rem;
}

.rp-steps summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--rp-primary);
    font-weight: 600;
}

.rp-steps ol {
    margin: 0.6rem 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--rp-text);
    line-height: 1.7;
}

.rp-result-error {
    padding: 1rem;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.rp-share {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    align-items: center;
    color: var(--rp-muted);
    font-size: 0.85rem;
}
.rp-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--rp-bg-alt);
    border: 1px solid var(--rp-border);
    border-radius: 50%;
    color: var(--rp-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all .15s;
}
.rp-share a:hover {
    background: var(--rp-primary-2);
    color: #fff;
    border-color: var(--rp-primary-2);
}

.rp-long-content {
    margin-top: 2.5rem;
    line-height: 1.7;
}

.rp-long-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
    color: var(--rp-primary);
    scroll-margin-top: 80px;
}
.rp-long-content h3 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--rp-text);
}

.rp-long-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.92rem;
}

.rp-long-content th,
.rp-long-content td {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--rp-border);
    text-align: left;
}

.rp-long-content th {
    background: var(--rp-bg-alt);
    font-weight: 600;
    color: var(--rp-primary);
}

.rp-faq {
    margin-top: 2.5rem;
    border-top: 2px solid var(--rp-border);
    padding-top: 2rem;
}

.rp-faq h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--rp-primary);
}

.rp-faq-item {
    border-top: 1px solid var(--rp-border);
    padding: 1rem 0;
}

.rp-faq-item:last-child {
    border-bottom: 1px solid var(--rp-border);
}

.rp-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.02rem;
    list-style: none;
    position: relative;
    padding-right: 2rem;
    color: var(--rp-text);
}
.rp-faq-item summary::-webkit-details-marker {
    display: none;
}

.rp-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.4rem;
    color: var(--rp-primary-2);
    line-height: 1;
    font-weight: 400;
}

.rp-faq-item[open] summary::after {
    content: "−";
}

.rp-faq-a {
    margin-top: 0.6rem;
    color: var(--rp-text);
    line-height: 1.6;
}

.rp-related {
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--rp-border);
}

.rp-related h3 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
    color: var(--rp-primary);
}

.rp-related ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.rp-related a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--rp-bg-alt);
    border: 1px solid var(--rp-border);
    border-radius: 999px;
    text-decoration: none;
    color: var(--rp-text);
    font-size: 0.88rem;
    transition: all .15s;
}

.rp-related a:hover {
    background: var(--rp-primary-2);
    border-color: var(--rp-primary-2);
    color: #fff;
}

.rp-ad {
    margin: 1.75rem 0;
    text-align: center;
}

.rp-ad-placeholder {
    background: #fff8e6;
    border: 1px dashed #d4a747;
    color: #92400e;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.8rem;
}

/* Mobile fine-tuning */
@media (max-width: 600px) {
    .rp-hero { padding: 2.5rem 1rem; }
    .rp-hero h1 { font-size: 1.75rem; }
    .rp-section { margin: 2rem auto; }
    .rp-trust-strip { gap: 1.25rem; font-size: 0.8rem; }
    .rp-result-primary { font-size: 1.6rem; }
}
