/* RomansCode — Core block/section styles (front-end).
 *
 * Shared structural CSS for the block system, loaded by every theme so blocks
 * render consistently regardless of theme. Per-block settings (background
 * colour, text colour) are emitted as inline styles by each section template
 * and layer on top of these rules.
 *
 * Uses CSS variables that themes define (--site-width, --line, --accent, --ink,
 * --muted, --radius), falling back to sensible defaults so blocks still render
 * if a theme doesn't define them.
 */

/* ---- Section shell ---- */
/* Edge-to-edge (full_bleed, the default state with no .rc-sec-contained):
   the section background runs the full viewport width while the inner wrap
   keeps content readable, centred and capped at the Site Width setting.
   Contained: the section's content area is capped at Site Width too — the
   background no longer bleeds past it. */
.rc-sec {
    width: 100%;
}
/* Full-bleed (no .rc-sec-contained): break out of any centred page wrapper
   (e.g. a theme's .site-wrap) so the section background reaches the viewport
   edges. The inner .rc-sec-wrap still re-centres content at Site Width.
   When the parent is already full-width, 50% == 50vw so the margins compute to
   0 — the rule is a no-op and does no harm. */
.rc-sec:not(.rc-sec-contained) {
    width: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
.rc-sec-wrap {
    /* Cap content at Site Width, but never wider than the widest preset
       (1440px) — so when Site Width is "Full" (100%) the background still
       bleeds while text stays readable instead of stretching the viewport. */
    max-width: min(var(--site-width, 1100px), 1440px);
    margin: 0 auto;
    padding: 0 32px;
}
.rc-sec-contained {
    /* Same ceiling as .rc-sec-wrap: a contained block keeps capping even when
       Site Width is "Full", so the edge-to-edge toggle stays meaningful. */
    max-width: min(var(--site-width, 1100px), 1440px);
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 768px) {
    .rc-sec-wrap { padding: 0 20px; }
}

/* When a page opens with a block section, let it sit flush under the header.
   Targets the shared theme hooks (.site-main > .site-wrap), so it works for any
   theme using that convention with no per-theme rule and no padding number to
   match. Pages that open with a .page article keep their padding untouched. */
.site-main:has(> .site-wrap > .rc-sec:first-child) {
    padding-top: 0;
}

/* ---- Vertical spacing presets ---- */
.rc-sec-spacing-narrow   { padding-top: 24px; padding-bottom: 24px; }
.rc-sec-spacing-standard { padding-top: 48px; padding-bottom: 48px; }
.rc-sec-spacing-spacious { padding-top: 88px; padding-bottom: 88px; }

/* ---- Shared eyebrow / title / subtitle ---- */
.rc-sec-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #2563eb);
    margin-bottom: 12px;
}
.rc-sec-title {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.1;
    margin: 0 0 16px;
}
.rc-sec-subtitle {
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink-soft, #4a4a4a);
    margin: 0 0 24px;
    max-width: 640px;
}

/* ---- Buttons inside blocks ---- */
.rc-sec-btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--line, #e6e6e6);
    border-radius: var(--radius, 8px);
    font-weight: 600;
    color: var(--ink, #1a1a1a);
    background: transparent;
    text-decoration: none;
    cursor: pointer;
}
.rc-sec-btn:hover { border-color: var(--ink, #1a1a1a); }
.rc-sec-btn-primary {
    background: var(--accent, #2563eb);
    border-color: var(--accent, #2563eb);
    color: #fff;
}
.rc-sec-btn-primary:hover {
    background: var(--accent-dark, #1d4ed8);
    border-color: var(--accent-dark, #1d4ed8);
}

/* ---- Hero ---- */
.rc-sec-hero .rc-sec-hero-content {
    max-width: 720px;
}
.rc-sec-hero-cover {
    background-size: cover;
    background-position: center;
}
.rc-sec-hero-left .rc-sec-wrap,
.rc-sec-hero-right .rc-sec-wrap {
    display: flex;
    align-items: center;
    gap: 40px;
}
.rc-sec-hero-right .rc-sec-wrap { flex-direction: row-reverse; }
.rc-sec-hero-image {
    flex: 1 1 0;
    max-width: 50%;
    border-radius: var(--radius, 8px);
    object-fit: cover;
}
.rc-sec-hero-left .rc-sec-hero-content,
.rc-sec-hero-right .rc-sec-hero-content {
    flex: 1 1 0;
}

/* ---- Features grid ---- */
.rc-sec-features-heading {
    font-size: clamp(26px, 3vw, 34px);
    margin: 0 0 8px;
    text-align: center;
}
.rc-sec-features-subtitle {
    text-align: center;
    color: var(--ink-soft, #4a4a4a);
    margin: 0 auto 32px;
    max-width: 640px;
}
.rc-sec-features-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, 1fr);
}
.rc-sec-features-cols-2 .rc-sec-features-grid { grid-template-columns: repeat(2, 1fr); }
.rc-sec-features-cols-4 .rc-sec-features-grid { grid-template-columns: repeat(4, 1fr); }
.rc-sec-features-item { text-align: left; }
.rc-sec-features-icon {
    color: var(--accent, #2563eb);
    margin-bottom: 12px;
}
.rc-sec-features-item-headline {
    font-size: 18px;
    margin: 0 0 8px;
}
.rc-sec-features-item-subline {
    color: var(--ink-soft, #4a4a4a);
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

/* ---- CTA ---- */
.rc-sec-cta .rc-sec-wrap { text-align: center; }
.rc-sec-cta-title {
    font-size: clamp(26px, 3.5vw, 38px);
    margin: 0 0 12px;
}
.rc-sec-cta-subtitle {
    color: var(--ink-soft, #4a4a4a);
    margin: 0 auto 24px;
    max-width: 560px;
}

/* ---- HTML / Text blocks ---- */
.rc-sec-html .rc-sec-wrap > *:first-child,
.rc-sec-text .rc-sec-wrap > *:first-child { margin-top: 0; }
.rc-sec-text .rc-sec-body { line-height: 1.7; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .rc-sec-features-grid,
    .rc-sec-features-cols-2 .rc-sec-features-grid,
    .rc-sec-features-cols-4 .rc-sec-features-grid { grid-template-columns: 1fr; }
    .rc-sec-hero-left .rc-sec-wrap,
    .rc-sec-hero-right .rc-sec-wrap { flex-direction: column; }
    .rc-sec-hero-image { max-width: 100%; }
}
