/**
 * Rhizarthrosis Plugin — UI Components
 * v3.0.0
 *
 * All plugin-injected UI: journey stepper, CTAs, newsletter, breadcrumbs.
 * Uses CSS custom properties from the Astra child theme.
 */

/* ── Design tokens — mirrors child theme variables exactly ───────────────── */
/*    (child theme overrides these when active; plugin works standalone too)  */
:root {
    /* Brand palette */
    --rz-primary:        #0d5c6b;
    --rz-primary-dark:   #094a57;
    --rz-primary-light:  #e6f4f7;
    --rz-accent:         #0d7377;

    /* Amber accent */
    --rz-amber:          #d97706;
    --rz-amber-dark:     #b45309;
    --rz-amber-light:    #fef3c7;
    --rz-amber-border:   #fde68a;

    /* Text */
    --rz-text:           #1a2332;
    --rz-text-muted:     #64748b;
    --rz-text-light:     #94a3b8;

    /* Surfaces */
    --rz-bg:             #ffffff;
    --rz-bg-subtle:      #f8fafc;
    --rz-bg-section:     #f1f5f9;
    --rz-border:         #e2e8f0;

    /* Typography */
    --rz-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* Animation */
    --rz-ease:           cubic-bezier(0.4, 0, 0.2, 1);
    --rz-dur:            160ms;

    /* Shadows */
    --rz-shadow-sm:      0 1px 4px rgba(0,0,0,.07);
    --rz-shadow-md:      0 4px 16px rgba(0,0,0,.09);
    --rz-shadow-lift:    0 6px 24px rgba(13,92,107,.13);
}

/* ── Reading progress bar ────────────────────────────────────────────────── */

.rz-reading-bar {
    position:   fixed;
    top:        0;
    left:       0;
    height:     3px;
    width:      0%;
    background: linear-gradient(90deg, var(--rz-primary) 0%, var(--rz-accent) 100%);
    z-index:    9999;
    transition: width 80ms linear;
    pointer-events: none;
}

/* ── Journey progress stepper ───────────────────────────────────────────── */

.rz-journey-nav {
    display:       flex;
    align-items:   center;
    gap:           0;
    background:    var(--rz-bg-subtle);
    border:        1px solid var(--rz-border);
    border-radius: 8px;
    padding:       14px 20px;
    margin-bottom: 40px;
    overflow-x:    auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rz-journey-nav::-webkit-scrollbar { display: none; }

.rz-journey-nav__track {
    display:     flex;
    align-items: center;
    list-style:  none;
    padding:     0;
    margin:      0;
    gap:         0;
    min-width:   max-content;
    width:       100%;
}

.rz-journey-nav__step {
    display:    flex;
    align-items: center;
    flex:        1;
    position:   relative;
    min-width:  0;
}

/* Connector line between steps */
.rz-journey-nav__step + .rz-journey-nav__step::before {
    content:    '';
    display:    block;
    flex-shrink: 0;
    height:     2px;
    width:      clamp(16px, 3vw, 40px);
    background: var(--rz-border);
    margin:     0 4px;
    transition: background var(--rz-dur) var(--rz-ease);
}

.rz-journey-nav__step.is-done + .rz-journey-nav__step::before {
    background: var(--rz-primary);
}

/* Step inner */
.rz-journey-nav__inner {
    display:        flex;
    flex-direction: column;
    align-items:    center;
    gap:            5px;
    text-decoration: none;
    cursor:         default;
}

a.rz-journey-nav__inner { cursor: pointer; }

/* Circle */
.rz-journey-nav__circle {
    display:         flex;
    align-items:     center;
    justify-content: center;
    width:           32px;
    height:          32px;
    border-radius:   50%;
    border:          2px solid var(--rz-border);
    background:      var(--rz-bg);
    font-size:       12px;
    font-weight:     700;
    color:           var(--rz-text-light);
    font-family:     var(--rz-font);
    transition:      background var(--rz-dur) var(--rz-ease),
                     border-color var(--rz-dur) var(--rz-ease),
                     color var(--rz-dur) var(--rz-ease);
    flex-shrink:     0;
    line-height:     1;
}

/* Step label */
.rz-journey-nav__label {
    font-size:   11px;
    font-weight: 500;
    color:       var(--rz-text-light);
    font-family: var(--rz-font);
    white-space: nowrap;
    transition:  color var(--rz-dur) var(--rz-ease);
}

/* ── Step states ────────────────────────────────────────────────────────── */

/* Done */
.rz-journey-nav__step.is-done .rz-journey-nav__circle {
    background:   var(--rz-primary);
    border-color: var(--rz-primary);
    color:        #ffffff;
}

.rz-journey-nav__step.is-done .rz-journey-nav__circle::after {
    content:    '✓';
    font-size:  13px;
    font-weight: 700;
}

.rz-journey-nav__step.is-done .rz-journey-nav__circle span { display: none; }

.rz-journey-nav__step.is-done .rz-journey-nav__label { color: var(--rz-primary); }

a.rz-journey-nav__inner:hover .rz-journey-nav__circle {
    border-color: var(--rz-primary);
    color:        var(--rz-primary);
}

/* Current / Active */
.rz-journey-nav__step.is-active .rz-journey-nav__circle {
    background:   var(--rz-primary);
    border-color: var(--rz-primary);
    color:        #ffffff;
    box-shadow:   0 0 0 4px var(--rz-primary-light);
}

.rz-journey-nav__step.is-active .rz-journey-nav__label {
    color:       var(--rz-primary);
    font-weight: 700;
}

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */

.rz-breadcrumbs,
.breadcrumbs {
    display:       flex;
    align-items:   center;
    flex-wrap:     wrap;
    gap:           6px;
    font-family:   var(--rz-font);
    font-size:     0.8rem;
    color:         var(--rz-text-muted);
    margin-bottom: 32px;
    padding:       10px 0;
    border-bottom: 1px solid var(--rz-border);
}

.rz-breadcrumbs a,
.breadcrumbs a {
    color:      var(--rz-text-muted);
    transition: color var(--rz-dur) var(--rz-ease);
}

.rz-breadcrumbs a:hover,
.breadcrumbs a:hover {
    color: var(--rz-primary);
}

.rz-breadcrumbs__sep,
.breadcrumbs__sep {
    color:    var(--rz-border);
    font-size: 1rem;
    line-height: 1;
}

/* ── Next Step CTA ───────────────────────────────────────────────────────── */

.rz-next-step {
    margin-top:     48px;
    background:     var(--rz-bg-subtle);
    border:         1px solid var(--rz-border);
    border-left:    4px solid var(--rz-primary);
    border-radius:  0 10px 10px 0;
    padding:        28px 32px;
    display:        flex;
    align-items:    center;
    justify-content: space-between;
    gap:            24px;
    flex-wrap:      wrap;
}

.rz-next-step__content { flex: 1; min-width: 0; }

.rz-next-step__eyebrow {
    font-size:      0.7rem;
    font-weight:    700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color:          var(--rz-primary);
    font-family:    var(--rz-font);
    margin-bottom:  6px;
}

.rz-next-step__title {
    font-size:     1.05rem;
    font-weight:   600;
    color:         var(--rz-text);
    line-height:   1.4;
    font-family:   var(--rz-font);
    margin:        0;
}

.rz-next-step__btn {
    display:        inline-flex;
    align-items:    center;
    gap:            8px;
    padding:        11px 22px;
    background:     var(--rz-primary);
    color:          #ffffff;
    font-family:    var(--rz-font);
    font-size:      0.9rem;
    font-weight:    600;
    border-radius:  5px;
    text-decoration: none;
    white-space:    nowrap;
    flex-shrink:    0;
    transition:     background var(--rz-dur) var(--rz-ease),
                    box-shadow var(--rz-dur) var(--rz-ease);
}

.rz-next-step__btn:hover {
    background:  var(--rz-primary-dark);
    color:       #ffffff;
    box-shadow:  0 4px 12px rgba(13,92,107,.25);
}

/* ── Stage-Aware CTA (posts) ─────────────────────────────────────────────── */

.rz-stage-cta {
    margin-top:    48px;
    border:        1px solid var(--rz-border);
    border-radius: 10px;
    padding:       24px 28px;
    display:       flex;
    align-items:   center;
    justify-content: space-between;
    gap:           20px;
    flex-wrap:     wrap;
    background:    var(--rz-bg-subtle);
}

.rz-stage-cta__text {
    flex:        1;
    min-width:   0;
    font-size:   0.9625rem;
    color:       var(--rz-text-muted);
    line-height: 1.6;
    font-family: var(--rz-font);
    margin:      0;
}

.rz-stage-cta__btn {
    display:        inline-flex;
    align-items:    center;
    gap:            8px;
    padding:        10px 20px;
    background:     var(--rz-primary);
    color:          #ffffff;
    font-family:    var(--rz-font);
    font-size:      0.875rem;
    font-weight:    600;
    border-radius:  5px;
    text-decoration: none;
    white-space:    nowrap;
    flex-shrink:    0;
    transition:     background var(--rz-dur) var(--rz-ease);
}

.rz-stage-cta__btn:hover {
    background: var(--rz-primary-dark);
    color:      #ffffff;
}

/* ── Newsletter CTA ──────────────────────────────────────────────────────── */

.rz-newsletter {
    margin-top:    56px;
    background:    var(--rz-primary);
    border-radius: 12px;
    padding:       40px 40px;
    color:         #ffffff;
}

.rz-newsletter__eyebrow {
    display:        inline-block;
    font-size:      0.7rem;
    font-weight:    700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color:          rgba(255,255,255,.65);
    font-family:    var(--rz-font);
    margin-bottom:  12px;
}

.rz-newsletter__title {
    font-size:      clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight:    800;
    color:          #ffffff;
    font-family:    var(--rz-font);
    letter-spacing: -0.02em;
    margin-bottom:  10px;
    line-height:    1.25;
}

.rz-newsletter__desc {
    font-size:     0.9375rem;
    color:         rgba(255,255,255,.78);
    line-height:   1.65;
    font-family:   var(--rz-font);
    margin-bottom: 28px;
    max-width:     56ch;
}

.rz-newsletter__form {}

.rz-newsletter__fields {
    display:   flex;
    gap:       10px;
    flex-wrap: wrap;
}

.rz-newsletter__input {
    flex:          1;
    min-width:     220px;
    padding:       11px 16px;
    font-family:   var(--rz-font);
    font-size:     0.9375rem;
    color:         var(--rz-text);
    background:    #ffffff;
    border:        2px solid transparent;
    border-radius: 5px;
    outline:       none;
    transition:    border-color var(--rz-dur) var(--rz-ease);
}

.rz-newsletter__input:focus {
    border-color: rgba(255,255,255,.4);
}

.rz-newsletter__input::placeholder {
    color: #94a3b8;
}

.rz-newsletter__btn {
    display:        inline-flex;
    align-items:    center;
    gap:            8px;
    padding:        11px 22px;
    background:     #ffffff;
    color:          var(--rz-primary);
    font-family:    var(--rz-font);
    font-size:      0.9rem;
    font-weight:    700;
    border:         none;
    border-radius:  5px;
    cursor:         pointer;
    white-space:    nowrap;
    flex-shrink:    0;
    transition:     background var(--rz-dur) var(--rz-ease),
                    color var(--rz-dur) var(--rz-ease);
}

.rz-newsletter__btn:hover {
    background: var(--rz-primary-light);
}

.rz-newsletter__btn:disabled {
    opacity: 0.65;
    cursor:  not-allowed;
}

.rz-newsletter__fine {
    font-size:  0.775rem;
    color:      rgba(255,255,255,.55);
    font-family: var(--rz-font);
    margin-top: 12px;
}

.rz-newsletter__status {
    margin-top:  12px;
    font-size:   0.875rem;
    font-weight: 600;
    font-family: var(--rz-font);
    min-height:  1.5em;
}

.rz-newsletter__status--ok    { color: #6ee7b7; }
.rz-newsletter__status--error { color: #fca5a5; }

/* ── Disclaimer ──────────────────────────────────────────────────────────── */

.rz-disclaimer {
    background:    var(--rz-amber-light);
    border:        1px solid var(--rz-amber-border);
    border-left:   4px solid var(--rz-amber);
    border-radius: 0 8px 8px 0;
    padding:       16px 20px;
    font-size:     0.85rem;
    color:         #7c3a0c;
    line-height:   1.65;
    font-family:   var(--rz-font);
}

.rz-disclaimer strong { color: #5c2a08; }

/* ── Utility ─────────────────────────────────────────────────────────────── */

.sr-only {
    position: absolute;
    width:    1px;
    height:   1px;
    padding:  0;
    margin:   -1px;
    overflow: hidden;
    clip:     rect(0,0,0,0);
    white-space: nowrap;
    border:   0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .rz-journey-nav {
        padding: 12px 16px;
    }

    .rz-journey-nav__label {
        display: none;
    }

    .rz-next-step {
        flex-direction: column;
        align-items:    flex-start;
        padding:        20px 22px;
    }

    .rz-next-step__btn {
        width: 100%;
        justify-content: center;
    }

    .rz-stage-cta {
        flex-direction: column;
        align-items:    flex-start;
    }

    .rz-stage-cta__btn {
        width: 100%;
        justify-content: center;
    }

    .rz-newsletter {
        padding: 28px 24px;
    }

    .rz-newsletter__fields {
        flex-direction: column;
    }

    .rz-newsletter__input,
    .rz-newsletter__btn {
        width: 100%;
    }
}

/* ==========================================================================
   TEMPLATE LAYOUTS
   Styles for page.php and single.php plugin templates.
   ========================================================================== */

/* ── Astra full-width reset — remove sidebar, force single column ───────── */

/* 1. White background so teal brand tokens don't bleed into page body */
body.page,
body.single {
    background-color: #ffffff !important;
}

body.page  .site-content,
body.single .site-content,
body.page  #content,
body.single #content {
    background-color: #ffffff !important;
}

/* 2. Kill Astra's sidebar flex layout — force block stacking */
body.page  .ast-content-layout-wrap,
body.single .ast-content-layout-wrap {
    display: block !important;
}

/* 3. Container: full width, no padding */
body.page  .ast-container,
body.single .ast-container {
    max-width: 100% !important;
    padding:   0    !important;
}

/* 4. Primary content column: full width, no float, no flex offset */
body.page  #primary,
body.single #primary {
    float:     none  !important;
    flex:      0 0 100% !important;
    max-width: 100%  !important;
    width:     100%  !important;
    padding:   0     !important;
}

/* 5. Hide sidebar completely */
body.page  #secondary,
body.single #secondary {
    display: none !important;
}

/* 6. Remove Astra article card wrapper chrome */
body.page  .ast-article-single,
body.page  .ast-article-post,
body.single .ast-article-single,
body.single .ast-article-post {
    padding:    0           !important;
    background: transparent !important;
    box-shadow: none        !important;
    border:     none        !important;
}

/* 7. Hide default Astra post chrome (we render our own) */
body.page  .entry-header,
body.page  .entry-footer,
body.page  .post-navigation,
body.page  .comments-area,
body.single .entry-header,
body.single .entry-footer,
body.single .post-navigation,
body.single .comments-area { display: none !important; }

/* ── Page hero ───────────────────────────────────────────────────────────── */

.rz-page-hero {
    background: linear-gradient(
        160deg,
        var(--rz-primary-dark)  0%,
        var(--rz-primary)       45%,
        var(--rz-accent)        100%
    );
    padding:    clamp(52px, 9vw, 88px) clamp(20px, 5vw, 48px);
    text-align: center;
    position:   relative;
    overflow:   hidden;
    color:      #ffffff;
}

.rz-page-hero::before {
    content:        '';
    position:       absolute;
    inset:          0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 50%, rgba(217,119,6,.06), transparent),
        radial-gradient(ellipse 500px 300px at 85% 30%, rgba(255,255,255,.04), transparent);
    pointer-events: none;
}

.rz-page-hero-inner {
    position:  relative;
    z-index:   2;
    max-width: 760px;
    margin:    0 auto;
}

.rz-page-hero h1 {
    font-size:      clamp(1.65rem, 4.5vw, 2.5rem);
    font-weight:    800;
    color:          #ffffff;
    margin:         0 0 16px;
    line-height:    1.2;
    letter-spacing: -0.03em;
    font-family:    var(--rz-font);
}

.rz-page-hero-excerpt {
    font-size:   1.05rem;
    color:       rgba(255,255,255,.85);
    line-height: 1.65;
    max-width:   600px;
    margin:      0 auto;
    font-family: var(--rz-font);
}

/* ── Post hero ───────────────────────────────────────────────────────────── */

.rz-post-hero {
    background: linear-gradient(
        160deg,
        var(--rz-primary-dark)  0%,
        var(--rz-primary)       45%,
        var(--rz-accent)        100%
    );
    padding:    clamp(52px, 9vw, 88px) clamp(20px, 5vw, 48px);
    text-align: center;
    position:   relative;
    overflow:   hidden;
    color:      #ffffff;
}

.rz-post-hero::before {
    content:        '';
    position:       absolute;
    inset:          0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 50%, rgba(217,119,6,.06), transparent),
        radial-gradient(ellipse 500px 300px at 85% 30%, rgba(255,255,255,.04), transparent);
    pointer-events: none;
}

.rz-post-hero-inner {
    position:  relative;
    z-index:   2;
    max-width: 680px;
    margin:    0 auto;
}

.rz-post-hero-cat {
    display:        inline-block;
    padding:        4px 14px;
    background:     rgba(217,119,6,.18);
    color:          #fbbf24;
    border-radius:  100px;
    font-size:      0.78rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom:  16px;
    font-family:    var(--rz-font);
}

.rz-post-hero h1 {
    font-size:      clamp(1.6rem, 4vw, 2.3rem);
    font-weight:    800;
    color:          #ffffff;
    margin:         0 0 20px;
    line-height:    1.22;
    letter-spacing: -0.03em;
    font-family:    var(--rz-font);
}

.rz-post-hero-meta {
    display:         flex;
    justify-content: center;
    gap:             20px;
    flex-wrap:       wrap;
    font-size:       0.875rem;
    color:           rgba(255,255,255,.6);
    font-family:     var(--rz-font);
}

.rz-post-hero-meta span {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
}

.rz-post-hero-meta svg {
    width:  15px;
    height: 15px;
    stroke: rgba(255,255,255,.45);
    fill:   none;
}

/* ── Outer page wrapper ──────────────────────────────────────────────────── */

.rz-page-outer {
    background: var(--rz-bg-subtle);
    min-height: 40vh;
}

/* ── Full-width layout (pillar pages with .rz-page blocks) ──────────────── */

.rz-page-full { width: 100%; }

/* ── Reading-width layout (simple pages: About, Contact, etc.) ──────────── */

.rz-page-read {
    max-width:     800px;
    margin:        48px auto;
    padding:       48px 44px;
    background:    var(--rz-bg);
    border-radius: 16px;
    box-shadow:    var(--rz-shadow-md, 0 4px 20px rgba(0,0,0,.07));
}

/* ── Single post layout ──────────────────────────────────────────────────── */

.rz-single-wrap {
    max-width: 760px;
    margin:    48px auto;
    padding:   0 20px;
}

.rz-single-card {
    background:    var(--rz-bg);
    border-radius: 16px;
    box-shadow:    var(--rz-shadow-md, 0 4px 20px rgba(0,0,0,.07));
    padding:       52px 44px;
    border-top:    3px solid var(--rz-primary);
    overflow:      hidden;
}

/* Featured image bleed to card edges */
.rz-single-thumb         { margin: -52px -44px 36px; overflow: hidden; }
.rz-single-thumb img     { width: 100%; height: auto; display: block; }

/* ── Content typography ──────────────────────────────────────────────────── */

.rz-page-full  .entry-content,
.rz-page-read  .entry-content,
.rz-single-card .entry-content {
    font-size:   1.0625rem;
    line-height: 1.78;
    color:       var(--rz-text);
    font-family: var(--rz-font);
}

.rz-page-full  .entry-content > *:first-child,
.rz-page-read  .entry-content > *:first-child,
.rz-single-card .entry-content > *:first-child { margin-top: 0; }

.rz-page-full  .entry-content h2,
.rz-page-read  .entry-content h2,
.rz-single-card .entry-content h2 {
    font-size:      clamp(1.4rem, 3vw, 1.875rem);
    font-weight:    700;
    color:          var(--rz-primary);
    margin-top:     2.5em;
    margin-bottom:  0.7em;
    line-height:    1.25;
    letter-spacing: -0.02em;
    font-family:    var(--rz-font);
}

.rz-page-full  .entry-content h2:first-child,
.rz-page-read  .entry-content h2:first-child,
.rz-single-card .entry-content h2:first-child { margin-top: 0; }

.rz-page-full  .entry-content h3,
.rz-page-read  .entry-content h3,
.rz-single-card .entry-content h3 {
    font-size:     clamp(1.15rem, 2.5vw, 1.375rem);
    font-weight:   600;
    color:         var(--rz-text);
    margin-top:    2em;
    margin-bottom: 0.6em;
    line-height:   1.3;
    font-family:   var(--rz-font);
}

.rz-page-full  .entry-content h4,
.rz-page-read  .entry-content h4,
.rz-single-card .entry-content h4 {
    font-size:     1.1rem;
    font-weight:   600;
    color:         var(--rz-text);
    margin-top:    1.5em;
    margin-bottom: 0.5em;
    font-family:   var(--rz-font);
}

.rz-page-full  .entry-content p,
.rz-page-read  .entry-content p,
.rz-single-card .entry-content p { margin-bottom: 1.1em; }

.rz-page-full  .entry-content ul,
.rz-page-read  .entry-content ul,
.rz-single-card .entry-content ul,
.rz-page-full  .entry-content ol,
.rz-page-read  .entry-content ol,
.rz-single-card .entry-content ol {
    padding-left:  1.6em;
    margin-bottom: 1.3em;
}

.rz-page-full  .entry-content li,
.rz-page-read  .entry-content li,
.rz-single-card .entry-content li { margin-bottom: 0.45em; line-height: 1.7; }

.rz-page-full  .entry-content a,
.rz-page-read  .entry-content a,
.rz-single-card .entry-content a {
    color:           var(--rz-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rz-page-full  .entry-content a:hover,
.rz-page-read  .entry-content a:hover,
.rz-single-card .entry-content a:hover { color: var(--rz-primary-dark); }

.rz-page-full  .entry-content img,
.rz-page-read  .entry-content img,
.rz-single-card .entry-content img {
    max-width:     100%;
    height:        auto;
    border-radius: 8px;
    display:       block;
    margin:        1.5em 0;
}

.rz-page-full  .entry-content blockquote,
.rz-page-read  .entry-content blockquote,
.rz-single-card .entry-content blockquote {
    border-left:   4px solid var(--rz-amber);
    background:    var(--rz-amber-light);
    padding:       16px 24px;
    margin:        1.75em 0;
    border-radius: 0 8px 8px 0;
    font-style:    italic;
    color:         #7c3a0c;
}

/* Tables */
.rz-page-full  .entry-content table,
.rz-page-read  .entry-content table,
.rz-single-card .entry-content table {
    width:           100%;
    border-collapse: collapse;
    margin:          1.5em 0;
    font-size:       0.9375rem;
}

.rz-page-full  .entry-content th,
.rz-page-read  .entry-content th,
.rz-single-card .entry-content th {
    background:    var(--rz-primary-light);
    color:         var(--rz-primary-dark);
    font-weight:   700;
    padding:       10px 14px;
    text-align:    left;
    border-bottom: 2px solid var(--rz-border);
}

.rz-page-full  .entry-content td,
.rz-page-read  .entry-content td,
.rz-single-card .entry-content td {
    padding:       9px 14px;
    border-bottom: 1px solid var(--rz-border);
    vertical-align: top;
}

.rz-page-full  .entry-content tr:last-child td,
.rz-page-read  .entry-content tr:last-child td,
.rz-single-card .entry-content tr:last-child td { border-bottom: none; }

/* Newsletter inside single card — keep it full-bleed */
.rz-single-card .rz-newsletter {
    margin-left:   -44px;
    margin-right:  -44px;
    margin-bottom: -52px;
    border-radius: 0 0 13px 13px;
}

/* ── Related articles grid ───────────────────────────────────────────────── */

.rz-related {
    max-width: 1200px;
    margin:    0 auto;
    padding:   64px 32px 48px;
}

.rz-related__heading {
    font-size:      1.5rem;
    font-weight:    800;
    color:          var(--rz-text);
    letter-spacing: -0.02em;
    margin-bottom:  36px;
    text-align:     center;
    font-family:    var(--rz-font);
}

.rz-related__grid {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   24px;
    align-items:           stretch;
}

.rz-related__card {
    display:         flex;
    flex-direction:  column;
    background:      var(--rz-bg);
    border-radius:   14px;
    overflow:        hidden;
    text-decoration: none;
    color:           inherit;
    transition:
        transform      var(--rz-dur, 180ms) var(--rz-ease, ease),
        box-shadow     var(--rz-dur, 180ms) var(--rz-ease, ease),
        border-color   var(--rz-dur, 180ms) var(--rz-ease, ease);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border:     1px solid var(--rz-border);
}

.rz-related__card:hover {
    transform:    translateY(-4px);
    box-shadow:   0 12px 32px -8px rgba(13,92,107,.18);
    border-color: var(--rz-primary);
}

.rz-related__img-wrap { overflow: hidden; }

.rz-related__img {
    width:      100%;
    height:     200px;
    object-fit: cover;
    display:    block;
    transition: transform 300ms ease;
}

.rz-related__card:hover .rz-related__img { transform: scale(1.03); }

.rz-related__placeholder {
    width:           100%;
    aspect-ratio:    16/9;
    background:      var(--rz-bg-subtle);
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.rz-related__placeholder svg {
    width:  32px;
    height: 32px;
    stroke: var(--rz-border);
    fill:   none;
}

.rz-related__body {
    padding:        20px 24px;
    flex:           1;
    display:        flex;
    flex-direction: column;
}

.rz-related__cat {
    display:        inline-block;
    padding:        3px 10px;
    background:     var(--rz-primary-light);
    color:          var(--rz-primary);
    border-radius:  4px;
    font-size:      0.72rem;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom:  10px;
    align-self:     flex-start;
    font-family:    var(--rz-font);
}

.rz-related__title {
    font-size:           0.9875rem;
    font-weight:         600;
    color:               var(--rz-text);
    line-height:         1.45;
    margin:              0;
    font-family:         var(--rz-font);
    display:             -webkit-box;
    -webkit-line-clamp:  2;
    -webkit-box-orient:  vertical;
    overflow:            hidden;
}

/* ── wp-block-latest-posts → card grid ───────────────────────────────────── */
/* Applied inside pillar page content (.rz-page-full .entry-content)         */

.entry-content .wp-block-latest-posts,
.wp-block-latest-posts {
    display:               grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:                   24px !important;
    list-style:            none !important;
    padding:               0    !important;
    margin:                32px 0 48px !important;
}

.entry-content .wp-block-latest-posts .wp-block-latest-posts__list-item,
.wp-block-latest-posts__list-item {
    background:    var(--rz-bg);
    border:        1px solid var(--rz-border);
    border-radius: 12px;
    overflow:      hidden;
    display:       flex;
    flex-direction: column;
    margin:        0 !important;
    transition:
        transform    var(--rz-dur) var(--rz-ease),
        box-shadow   var(--rz-dur) var(--rz-ease),
        border-color var(--rz-dur) var(--rz-ease);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wp-block-latest-posts__list-item:hover {
    transform:    translateY(-3px);
    box-shadow:   0 10px 28px rgba(13,92,107,.15);
    border-color: var(--rz-primary);
}

/* Featured image */
.wp-block-latest-posts__featured-image {
    overflow:      hidden;
    border-radius: 0;
    margin:        0;
    flex-shrink:   0;
}

.wp-block-latest-posts__featured-image a { display: block; }

.wp-block-latest-posts__featured-image img {
    width:       100%;
    height:      180px !important;
    object-fit:  cover;
    display:     block;
    margin:      0 !important;
    border-radius: 0;
    transition:  transform 300ms ease;
}

.wp-block-latest-posts__list-item:hover .wp-block-latest-posts__featured-image img {
    transform: scale(1.04);
}

/* Content area below image */
.wp-block-latest-posts__list-item > a,
.wp-block-latest-posts__list-item .wp-block-latest-posts__post-excerpt,
.wp-block-latest-posts__list-item .wp-block-latest-posts__post-date {
    padding-left:  20px;
    padding-right: 20px;
}

/* Title link */
.wp-block-latest-posts__list-item > a:first-of-type,
.wp-block-latest-posts .wp-block-latest-posts__list-item > a {
    display:         block;
    font-family:     var(--rz-font);
    font-weight:     600;
    font-size:       0.9875rem;
    color:           var(--rz-text) !important;
    text-decoration: none !important;
    line-height:     1.45;
    padding-top:     18px;
    padding-bottom:  4px;
    transition:      color var(--rz-dur) var(--rz-ease);
}

.wp-block-latest-posts__list-item > a:hover {
    color: var(--rz-primary) !important;
}

/* Excerpt */
.wp-block-latest-posts__post-excerpt {
    font-family: var(--rz-font);
    font-size:   0.85rem;
    color:       var(--rz-text-muted);
    line-height: 1.6;
    margin-top:  6px;
    padding-bottom: 4px;
    flex: 1;
}

/* Date */
.wp-block-latest-posts__post-date {
    display:       block;
    font-family:   var(--rz-font);
    font-size:     0.75rem;
    color:         var(--rz-text-light);
    padding-top:   10px;
    padding-bottom: 16px;
    margin-top:    0;
}

/* ── wp-block-query (Query Loop) → card grid ─────────────────────────────── */

.entry-content .wp-block-query .wp-block-post-template,
.wp-block-query .wp-block-post-template {
    display:               grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap:                   24px !important;
    list-style:            none !important;
    padding:               0    !important;
    margin:                32px 0 48px !important;
}

.wp-block-query .wp-block-post {
    background:    var(--rz-bg);
    border:        1px solid var(--rz-border);
    border-radius: 12px;
    overflow:      hidden;
    transition:
        transform    var(--rz-dur) var(--rz-ease),
        box-shadow   var(--rz-dur) var(--rz-ease),
        border-color var(--rz-dur) var(--rz-ease);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wp-block-query .wp-block-post:hover {
    transform:    translateY(-3px);
    box-shadow:   0 10px 28px rgba(13,92,107,.15);
    border-color: var(--rz-primary);
}

/* Post featured image in query loop */
.wp-block-query .wp-block-post-featured-image { overflow: hidden; }

.wp-block-query .wp-block-post-featured-image img {
    width:       100%;
    height:      180px !important;
    object-fit:  cover;
    display:     block;
    margin:      0 !important;
    border-radius: 0;
    transition:  transform 300ms ease;
}

.wp-block-query .wp-block-post:hover .wp-block-post-featured-image img {
    transform: scale(1.04);
}

/* Post title in query loop */
.wp-block-query .wp-block-post-title {
    font-family:   var(--rz-font);
    font-size:     0.9875rem;
    font-weight:   600;
    line-height:   1.45;
    padding:       16px 20px 4px;
    margin:        0;
}

.wp-block-query .wp-block-post-title a {
    color:           var(--rz-text) !important;
    text-decoration: none !important;
    transition:      color var(--rz-dur) var(--rz-ease);
}

.wp-block-query .wp-block-post-title a:hover { color: var(--rz-primary) !important; }

/* Excerpt in query loop */
.wp-block-query .wp-block-post-excerpt {
    padding:     0 20px;
    font-family: var(--rz-font);
    font-size:   0.85rem;
    color:       var(--rz-text-muted);
    line-height: 1.6;
}

/* ── Disclaimer (template-level) ─────────────────────────────────────────── */

.rz-template-disclaimer {
    max-width: 760px;
    margin:    0 auto;
    padding:   40px 20px 64px;
}

/* ── Article card grid (.rz-article-grid / .rz-article-card) ─────────────── */
/* Used in pillar page content to display related blog posts as cards         */

.rz-article-grid {
    display:               grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap:                   20px;
    margin:                32px 0 48px;
}

.rz-article-card {
    background:     var(--rz-bg);
    border:         1px solid var(--rz-border);
    border-top:     3px solid var(--rz-primary);
    border-radius:  12px;
    padding:        24px 28px;
    display:        flex;
    flex-direction: column;
    gap:            10px;
    box-shadow:     0 2px 8px rgba(0,0,0,.05);
    transition:
        transform      var(--rz-dur, 160ms) var(--rz-ease, ease),
        box-shadow     var(--rz-dur, 160ms) var(--rz-ease, ease),
        border-top-color var(--rz-dur, 160ms) var(--rz-ease, ease);
}

.rz-article-card:hover {
    transform:            translateY(-3px);
    box-shadow:           0 10px 28px rgba(13,92,107,.14);
    border-top-color:     var(--rz-accent);
}

.rz-article-card h3 {
    font-size:   1rem;
    font-weight: 600;
    line-height: 1.4;
    margin:      0;
    font-family: var(--rz-font);
    color:       var(--rz-text);
}

.rz-article-card h3 a {
    color:           var(--rz-text) !important;
    text-decoration: none !important;
    transition:      color var(--rz-dur, 160ms) var(--rz-ease, ease);
}

.rz-article-card:hover h3 a,
.rz-article-card h3 a:hover {
    color: var(--rz-primary) !important;
}

.rz-article-card p {
    font-size:              0.875rem;
    color:                  var(--rz-text-muted);
    line-height:            1.6;
    margin:                 0;
    flex:                   1;
    display:                -webkit-box;
    -webkit-line-clamp:     3;
    -webkit-box-orient:     vertical;
    overflow:               hidden;
}

/* ── FAQ items (.rz-faq-item) ─────────────────────────────────────────────── */

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

.rz-faq-item + .rz-faq-item:last-of-type {
    border-bottom: 1px solid var(--rz-border);
}

.rz-faq-item h3 {
    font-size:   1.05rem;
    font-weight: 600;
    color:       var(--rz-primary);
    margin:      0 0 8px;
    font-family: var(--rz-font);
    line-height: 1.3;
}

.rz-faq-item p {
    font-size:   0.9375rem;
    color:       var(--rz-text);
    line-height: 1.75;
    margin:      0;
}

/* ── Cross-links / Explore More (.rz-cross-links) ────────────────────────── */

.rz-cross-links {
    background:    var(--rz-bg-subtle);
    border-radius: 12px;
    padding:       24px 28px;
    margin:        32px 0;
}

.rz-cross-links ul {
    list-style:  none;
    padding:     0;
    margin:      0;
    display:     flex;
    flex-wrap:   wrap;
    gap:         10px;
}

.rz-cross-links li { margin: 0; }

.rz-cross-links a {
    display:         inline-flex;
    align-items:     center;
    padding:         8px 18px;
    background:      var(--rz-bg);
    border:          1px solid var(--rz-border);
    border-radius:   100px;
    font-size:       0.875rem;
    font-weight:     500;
    color:           var(--rz-text) !important;
    text-decoration: none !important;
    font-family:     var(--rz-font);
    transition:
        color         var(--rz-dur, 160ms) var(--rz-ease, ease),
        border-color  var(--rz-dur, 160ms) var(--rz-ease, ease),
        background    var(--rz-dur, 160ms) var(--rz-ease, ease);
}

.rz-cross-links a:hover {
    color:        var(--rz-primary) !important;
    border-color: var(--rz-primary);
    background:   var(--rz-primary-light);
}

/* ── Template-specific responsive ───────────────────────────────────────── */

@media (max-width: 900px) {
    .rz-related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .rz-page-read {
        margin:  24px 16px;
        padding: 28px 20px;
    }

    .rz-single-wrap { margin: 24px auto; padding: 0 14px; }

    .rz-single-card {
        padding:       28px 20px;
        border-radius: 12px;
    }

    .rz-single-thumb {
        margin: -28px -20px 28px;
    }

    .rz-single-card .rz-newsletter {
        margin-left:   -20px;
        margin-right:  -20px;
        margin-bottom: -28px;
        border-radius: 0 0 11px 11px;
    }

    .rz-related        { padding: 48px 16px; }
    .rz-related__grid  { grid-template-columns: 1fr; gap: 16px; }
    .rz-related__img   { height: 160px; }

    .rz-template-disclaimer { padding: 28px 16px 48px; }
}
