/* ==========================================================================
   EDITOR STYLES — matches frontend look inside block editor iframe
   ========================================================================== */

/* ---------- ROOT VARIABLES (must be redeclared for editor iframe) ---------- */
:root {
    --hs-primary: #161e4b;
    --hs-secondary: #2849a4;
    --hs-warning: #ffcb3d;
    --hs-bg: #f4f8fd;
    --hs-text: #1f2937;
    --hs-muted: #667085;
    --hs-card: #ffffff;
    --hs-border: rgba(22, 30, 75, 0.08);
    --hs-shadow: 0 12px 40px rgba(19, 30, 73, 0.12);
    --hs-radius: 22px;
    --hs-accent: #58a88b;
    --hs-accent-dark: #3e8d72;
}

/* ---------- BASE ---------- */
.editor-styles-wrapper {
    font-family: 'Asap', sans-serif;
    color: var(--hs-text);
    background: #fff;
    font-size: 16px;
    line-height: 1.6;
}

.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4 {
    color: var(--hs-primary);
    font-weight: 700;
    line-height: 1.2;
}

.editor-styles-wrapper h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.editor-styles-wrapper h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.editor-styles-wrapper h3 { font-size: 1.25rem; }

.editor-styles-wrapper p {
    color: var(--hs-text);
    line-height: 1.7;
}

.editor-styles-wrapper a {
    color: var(--hs-secondary);
    text-decoration: none;
}

.editor-styles-wrapper a:hover {
    color: var(--hs-accent-dark);
    text-decoration: underline;
}

/* ---------- LAYOUT: match theme.json sizes ---------- */
.editor-styles-wrapper .wp-block {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.editor-styles-wrapper .wp-block[data-align="wide"] {
    max-width: 1400px;
}

.editor-styles-wrapper .wp-block[data-align="full"] {
    max-width: none;
    width: 100%;
}

/* ---------- GROUP CONTAINERS ---------- */
.editor-styles-wrapper .wp-block-group {
    box-sizing: border-box;
}

.editor-styles-wrapper .wp-block-group.is-layout-constrained > * {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.editor-styles-wrapper .wp-block-group.is-layout-constrained > .alignwide {
    max-width: 1400px;
}

.editor-styles-wrapper .wp-block-group.is-layout-constrained > .alignfull {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* ---------- HERO / COVER ---------- */
.editor-styles-wrapper .wp-block-cover {
    color: #fff;
}

.editor-styles-wrapper .wp-block-cover .wp-block-cover__inner-container {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.editor-styles-wrapper .wp-block-cover h1,
.editor-styles-wrapper .wp-block-cover h2 {
    color: #fff;
}

.editor-styles-wrapper .wp-block-cover p {
    color: rgba(255, 255, 255, .9);
}

/* ---------- YOUR CUSTOM CLASSES (mirror frontend) ---------- */
.editor-styles-wrapper .hs-container {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.editor-styles-wrapper .hs-section {
    padding: 4rem 0;
}

.editor-styles-wrapper .hs-section-light {
    background: var(--hs-bg);
}

.editor-styles-wrapper .hs-card {
    background: var(--hs-card);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    box-shadow: var(--hs-shadow);
    padding: 1.75rem;
    height: 100%;
}

.editor-styles-wrapper .hs-card h3 {
    color: var(--hs-primary);
    margin-bottom: .85rem;
}

.editor-styles-wrapper .hs-card p {
    color: var(--hs-muted);
    margin-bottom: 1rem;
}

.editor-styles-wrapper .hs-cta {
    background: linear-gradient(135deg, var(--hs-primary), var(--hs-secondary));
    color: #fff;
    border-radius: 28px;
    padding: 2.5rem;
    text-align: center;
}

.editor-styles-wrapper .hs-cta h2,
.editor-styles-wrapper .hs-cta p {
    color: #fff;
}

.editor-styles-wrapper .eyebrow {
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .85);
    margin-bottom: .75rem;
}

/* ---------- BUTTONS ---------- */
.editor-styles-wrapper .wp-block-button__link {
    background: linear-gradient(135deg, var(--hs-accent), var(--hs-accent-dark));
    color: #fff;
    border-radius: 50px;
    padding: .85rem 1.75rem;
    font-weight: 600;
    font-size: .95rem;
    box-shadow: 0 10px 24px rgba(88, 168, 139, .28);
    text-decoration: none;
}

.editor-styles-wrapper .wp-block-button__link:hover {
    filter: brightness(1.08);
    color: #fff;
    text-decoration: none;
}

/* ---------- COLUMNS ---------- */
.editor-styles-wrapper .wp-block-columns {
    gap: 1.5rem;
}

.editor-styles-wrapper .wp-block-column {
    box-sizing: border-box;
}

/* ---------- NAVIGATION ---------- */
.editor-styles-wrapper .wp-block-navigation a {
    color: var(--hs-primary);
    font-weight: 500;
}

.editor-styles-wrapper .wp-block-navigation a:hover {
    color: var(--hs-accent-dark);
}

/* ---------- QUERY / POST TEMPLATE ---------- */
.editor-styles-wrapper .wp-block-post-title a {
    color: var(--hs-primary);
    text-decoration: none;
}

.editor-styles-wrapper .wp-block-post-excerpt {
    color: var(--hs-muted);
}

/* ---------- EDITOR-ONLY CHROME FIXES ---------- */
/* Remove default WP margins that make things look cramped */
.editor-styles-wrapper .block-editor-block-list__layout > * {
    margin-block-start: 0;
}

/* Block appender & placeholder alignment */
.editor-styles-wrapper .block-list-appender {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

/* Full-width blocks inside editor should not have horizontal scroll */
.editor-styles-wrapper .wp-block[data-align="full"] {
    overflow-x: hidden;
}

/* Cover inner spacing in editor */
.editor-styles-wrapper .wp-block-cover .block-editor-block-list__layout {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Remove default padding around the editing area */
.editor-styles-wrapper .is-root-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

/* The block list layout should fill the space */
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container {
    padding: 0 !important;
    margin: 0 !important;
}

/* But individual blocks should still be constrained */
.editor-styles-wrapper .is-root-container > .wp-block {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.editor-styles-wrapper .is-root-container > .wp-block[data-align="wide"] {
    max-width: 1400px;
}

.editor-styles-wrapper .is-root-container > .wp-block[data-align="full"] {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
}

/* Full-width groups should extend edge to edge */
.editor-styles-wrapper .wp-block-group.alignfull {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

/* Section spacing */
.editor-styles-wrapper .wp-block-group.hs-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Inner containers within sections should be constrained */
.editor-styles-wrapper .wp-block-group.hs-container {
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    width: 100%;
}

/* Cover block — force white text like frontend */
.editor-styles-wrapper .wp-block-cover,
.editor-styles-wrapper .wp-block-cover h1,
.editor-styles-wrapper .wp-block-cover h2,
.editor-styles-wrapper .wp-block-cover h3,
.editor-styles-wrapper .wp-block-cover h4,
.editor-styles-wrapper .wp-block-cover h5,
.editor-styles-wrapper .wp-block-cover h6,
.editor-styles-wrapper .wp-block-cover p,
.editor-styles-wrapper .wp-block-cover li,
.editor-styles-wrapper .wp-block-cover a:not(.wp-block-button__link) {
    color: #fff !important;
}

/* Cover paragraph slightly muted like frontend */
.editor-styles-wrapper .wp-block-cover p {
    color: rgba(255, 255, 255, .9) !important;
}

/* Cover overlay dim layer must stay visible */
.editor-styles-wrapper .wp-block-cover__background {
    opacity: .7;
}

/* Eyebrow in hero */
.editor-styles-wrapper .wp-block-cover .eyebrow {
    color: rgba(255, 255, 255, .85) !important;
}

/* CTA banner — white text */
.editor-styles-wrapper .hs-cta,
.editor-styles-wrapper .hs-cta h1,
.editor-styles-wrapper .hs-cta h2,
.editor-styles-wrapper .hs-cta h3,
.editor-styles-wrapper .hs-cta p {
    color: #fff !important;
}