/* =========================================================
   Dynamic Rows Block
   ========================================================= */

.dynamic-rows {
    padding: 4rem 2rem;
    box-sizing: border-box;
}

/* The default page template constrains non-wp-block children with max-width
   and margin-left. Reset those on the section so the background is full-bleed. */
.page-template-default .entry-content > .SDblock.dynamic-rows {
    max-width: none;
    margin-left: 0;
    width: 100%;
}

/* Inner content wrapper — always constrained to --maxWidth, centered */
.dr-inner {
    width: 100%;
    max-width: var(--maxWidth);
    margin-left: auto;
    margin-right: auto;
}

/* Section heading */
.dr-section-heading {
    margin: 0 0 3rem;
}

/* Section Heading Type Role — only applies when a role is chosen on the
   block (data-dr-heading-role present); falls back to the theme's H2
   tokens for any property the role itself didn't set. */
.dynamic-rows[data-dr-heading-role] .dr-section-heading {
    font-family:    var(--dr-heading-family, var(--h2-font));
    font-weight:    var(--dr-heading-weight, var(--h2-weight));
    font-style:     var(--dr-heading-style, normal);
    font-size:      var(--dr-heading-size, var(--h2Size));
    line-height:    var(--dr-heading-line-height, normal);
    letter-spacing: var(--dr-heading-letter-spacing, var(--h2-tracking));
    text-transform: var(--dr-heading-text-transform, var(--h2-transform));
}

/* Row list */
.dr-rows {
    display: flex;
    flex-direction: column;
}

/* Individual row — 2 columns: icon | content */
.dr-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 2rem;
    align-items: start;
    padding: 3rem 0;
}

/* Icon column */
.dr-row__icon {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.25rem;
}

.dr-svg-wrap {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dr-svg-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* SVG paths: fills hidden until phase 2; DrawSVG handles stroke drawing */
.dr-svg-wrap svg path,
.dr-svg-wrap svg polyline,
.dr-svg-wrap svg polygon,
.dr-svg-wrap svg line,
.dr-svg-wrap svg circle,
.dr-svg-wrap svg ellipse,
.dr-svg-wrap svg rect {
    stroke-dashoffset: 1px; /* GSAP DrawSVG will handle this */
    fill-opacity: 0;        /* fills reveal after strokes are drawn */
}

/* Content column */
.dr-row__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

#SD .dynamic-rows .dr-row__heading {
    margin: 0;
    font-family:    var(--subhead-font);
    font-weight:    var(--subhead-weight);
    text-transform: var(--subhead-transform);
    letter-spacing: var(--subhead-tracking);
    font-size:      var(--subhead-size);
    color:          var(--subhead-color);
}

#SD .dynamic-rows.is-dark-bg .dr-row__heading {
    color: var(--subhead-color-dark);
}

/* Row Heading Type Role — only applies when a role is chosen on the block
   (data-dr-row-heading-role present); falls back to the existing subhead
   tokens above for any property the role itself didn't set. */
.dynamic-rows[data-dr-row-heading-role] .dr-row__heading {
    font-family:    var(--dr-row-heading-family, var(--subhead-font));
    font-weight:    var(--dr-row-heading-weight, var(--subhead-weight));
    font-style:     var(--dr-row-heading-style, normal);
    text-transform: var(--dr-row-heading-text-transform, var(--subhead-transform));
    letter-spacing: var(--dr-row-heading-letter-spacing, var(--subhead-tracking));
    font-size:      var(--dr-row-heading-size, var(--subhead-size));
    line-height:    var(--dr-row-heading-line-height, normal);
    color:          var(--dr-row-heading-color, var(--subhead-color));
}

.dynamic-rows[data-dr-row-heading-role].is-dark-bg .dr-row__heading {
    color: var(--dr-row-heading-color, var(--subhead-color-dark));
}

/* Body — description and bullets side by side, sharing top alignment */
.dr-row__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    width: 100%;
}

.dr-row__description {
    margin: 0;
}

/* Row Description Type Role — only applies when a role is chosen on the
   block (data-dr-row-desc-role present); the description has no hardcoded
   font styling of its own, so unset properties fall back to inherit. */
.dynamic-rows[data-dr-row-desc-role] .dr-row__description {
    font-family:    var(--dr-row-desc-family, inherit);
    font-weight:    var(--dr-row-desc-weight, inherit);
    font-style:     var(--dr-row-desc-style, inherit);
    font-size:      var(--dr-row-desc-size, inherit);
    line-height:    var(--dr-row-desc-line-height, inherit);
    letter-spacing: var(--dr-row-desc-letter-spacing, inherit);
    text-transform: var(--dr-row-desc-text-transform, inherit);
    color:          var(--dr-row-desc-color, inherit);
}

/* Bullets */
.dr-row__bullets {
    list-style: disc;
    margin: 0;
    padding: 0 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Bullet Type Role — only applies when a role is chosen on the block
   (data-dr-row-bullet-role present); unset properties fall back to inherit. */
.dynamic-rows[data-dr-row-bullet-role] .dr-row__bullets {
    font-family:    var(--dr-row-bullet-family, inherit);
    font-weight:    var(--dr-row-bullet-weight, inherit);
    font-style:     var(--dr-row-bullet-style, inherit);
    font-size:      var(--dr-row-bullet-size, inherit);
    line-height:    var(--dr-row-bullet-line-height, inherit);
    letter-spacing: var(--dr-row-bullet-letter-spacing, inherit);
    text-transform: var(--dr-row-bullet-text-transform, inherit);
    color:          var(--dr-row-bullet-color, inherit);
}

/* Buttons */
.dr-row__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dr-btn-gap, 0.75rem);
}

/* Legacy #SD A.button (SDstandards.css) sets a global margin-right: 24px on
   every button — override it here so Button Gap above is the only spacing
   between buttons in this block. */
#SD .dr-row__buttons .dr-row__btn {
    margin: 0;
}

/* Reveal — content items start hidden */
[data-dr-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity var(--dr-duration, 0.55s) cubic-bezier(0.22, 1, 0.36, 1),
        transform var(--dr-duration, 0.55s) cubic-bezier(0.22, 1, 0.36, 1);
}

[data-dr-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for content items within a row */
.dr-row__heading[data-dr-reveal]     { transition-delay: 0ms; }
.dr-row__description[data-dr-reveal] { transition-delay: 80ms; }
.dr-row__bullets li[data-dr-reveal]  { transition-delay: calc(160ms + var(--dr-bullet-index, 0) * 60ms); }
.dr-row__btn[data-dr-reveal]         { transition-delay: 320ms; }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
    .dynamic-rows {
        padding: 3rem 1.25rem;
    }

    /* Stack: icon / content each full width */
    .dr-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 2rem 0;
    }

    .dr-row__icon {
        justify-content: flex-start;
    }

    .dr-svg-wrap {
        width: 120px;
        height: 120px;
    }

    /* Stack description and bullets vertically on small screens */
    .dr-row__body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
