/* ============================================================
   RECHNERLAB — 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: blauw — exact het blitzrechner-palette want het werkt aantoonbaar voor calculator-sites.
   ============================================================ */

:root {
    --rl-primary: #123956;        /* donkerblauw — header, tekst-accent */
    --rl-primary-2: #349ff0;      /* helder blauw — knoppen, results */
    --rl-primary-soft: #e0eef9;   /* zacht blauw — result block bg */
    --rl-accent: #e0704d;         /* warme oranje — highlights, CTA */
    --rl-bg: #ffffff;
    --rl-bg-alt: #f8faf9;         /* subtiele off-white voor kaarten */
    --rl-card: #ffffff;
    --rl-border: #e3e8ef;
    --rl-text: #1a1f2c;
    --rl-muted: #5b6478;
    --rl-radius: 12px;
    --rl-shadow: 0 1px 3px rgba(0,0,0,.04), 0 6px 16px rgba(18,57,86,.07);
}

/* ============================================================
   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(.rl-btn):not(.rl-tool-card):not(.rl-related a):not(.rl-share a):not(.rl-breadcrumb a):not(.wp-block-site-title a) {
    color: var(--rl-primary-2);
}
.wp-site-blocks h1, .wp-site-blocks h2, .wp-site-blocks h3 {
    color: var(--rl-primary);
}
/* Branded site title in theme header */
.wp-block-site-title a, .wp-block-site-title a:visited {
    color: var(--rl-primary) !important;
    font-weight: 700;
}
/* Branded primary navigation items */
.wp-block-navigation a {
    color: var(--rl-text);
    font-weight: 500;
}
.wp-block-navigation a:hover {
    color: var(--rl-primary-2);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.rl-result-table tr {
    border-top: 1px solid rgba(18,57,86,.18);
}

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

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

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

.rl-steps {
    margin-top: 1rem;
    border-top: 1px dashed rgba(18,57,86,.28);
    padding-top: 0.85rem;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.rl-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) {
    .rl-hero { padding: 2.5rem 1rem; }
    .rl-hero h1 { font-size: 1.75rem; }
    .rl-section { margin: 2rem auto; }
    .rl-trust-strip { gap: 1.25rem; font-size: 0.8rem; }
    .rl-result-primary { font-size: 1.6rem; }
}
