/**
 * Shared block styles for mobile editor and reflow player
 * This file ensures consistent text rendering between editing and viewing
 *
 * Include this file BEFORE mobile-editor.css and reflow-player.css
 */

/* Base block spacing */
.block {
    margin-bottom: 24px;
    position: relative;
}

/* Title blocks */
.block-title {
    font-family: var(--theme-heading-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: var(--theme-heading-weight, 700);
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.15;
    letter-spacing: var(--theme-letter-spacing, -0.02em);
    margin: 0 0 20px 0;
    word-break: keep-all;
    white-space: normal;
    hyphens: none;
}

/* Subtitle blocks */
.block-subtitle {
    font-family: var(--theme-heading-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: 500;
    font-size: clamp(18px, 5vw, 28px);
    line-height: 1.25;
    letter-spacing: var(--theme-letter-spacing, 0);
    opacity: 0.85;
    margin: 0 0 20px 0;
    word-break: keep-all;
    white-space: normal;
    hyphens: none;
}

/* Body text blocks */
.block-body {
    font-family: var(--theme-body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-weight: var(--theme-body-weight, 400);
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: var(--theme-line-height, 1.5);
    margin: 0 0 20px 0;
    word-break: keep-all;
    white-space: normal;
    hyphens: none;
}

/* Quote blocks */
.block-quote {
    font-family: var(--theme-body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-style: italic;
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.4;
    padding: 16px 20px;
    border-left: 4px solid var(--theme-secondary, currentColor);
    background: rgba(255,255,255,0.08);
    border-radius: 0 12px 12px 0;
    margin: 0 0 20px 0;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* Bullet list blocks - base styles.
 * The player renders bullets as inline <span class="bullet-accent"> inside a
 * <div class="block-bullet-list"> (see reflow-player.src.js formatBulletList),
 * not as <li> elements. The editor renders <ul class="block-bullet-list"><li>
 * and owns all li styling in mobile-editor.css L510+. So no li::before rules
 * are needed here — they were dead for the player and collided with the
 * editor's rules (producing double-bullets via CSS cascade). */
.block-bullet-list,
.block-bullets {
    font-family: var(--theme-body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: var(--theme-line-height, 1.6);
    margin: 0 0 20px 0;
    padding-left: 0;
    list-style: none;
}

/* Image blocks */
.block-image {
    border-radius: var(--theme-image-radius, 12px);
    overflow: hidden;
    background: rgba(0,0,0,0.2);
    margin-bottom: 24px;
    box-shadow: var(--theme-image-shadow, none);
}

.block-image img {
    width: 100%;
    display: block;
}

/* Resolved AI-generated images */
.block-resolved-image {
    margin: 24px 0;
    border-radius: var(--theme-image-radius, 16px);
    overflow: hidden;
    box-shadow: var(--theme-image-shadow, 0 8px 32px rgba(0, 0, 0, 0.15));
}

.block-resolved-image img {
    width: 100%;
    display: block;
}

/* Screen content container - shared base */
.screen-content {
    min-height: 100%;
    padding: var(--theme-padding-y, 40px) var(--theme-padding-x, 24px) 80px var(--theme-padding-x, 24px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    text-align: var(--theme-text-align, center);
    max-width: var(--theme-content-width, 90%);
    margin-left: var(--theme-content-offset, auto);
    margin-right: auto;
    gap: var(--theme-element-gap, 16px);
}

/* First screen gets top padding for header */
.screen:first-child .screen-content {
    padding-top: max(70px, calc(env(safe-area-inset-top) + 16px));
}

/* Title screens - both .screen-title and .screen-type-title for compatibility */
.screen-title .screen-content,
.screen-type-title .screen-content {
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.screen-title .block-title,
.screen-type-title .block-title {
    font-size: clamp(42px, 12vw, 72px) !important;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.screen-title .block-subtitle,
.screen-type-title .block-subtitle {
    font-size: clamp(20px, 5vw, 32px) !important;
    line-height: 1.35;
    opacity: 0.8;
    font-weight: 400;
}

/* Images on title screens - full width, centered */
.screen-title .block-image,
.screen-type-title .block-image {
    max-width: 100%;
    width: 100%;
    margin: 0 auto 24px auto;
}

/* Closing screens - always centered regardless of theme */
.screen-type-closing .screen-content {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 32px;
    margin-left: auto;
    margin-right: auto;
}

.screen-type-closing .block-title {
    font-size: clamp(42px, 12vw, 72px) !important;
    line-height: 1.1;
    margin-bottom: 20px;
}

/* Hero screens - text over background */
.screen-hero .screen-content .block-title,
.screen-hero .screen-content .block-subtitle,
.screen-hero .screen-content .block-body {
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ==========================================
   Theme Decorations
   ========================================== */

/* Decorations container - sits behind content */
.screen-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Content should sit above decorations */
.screen-content {
    position: relative;
    z-index: 2;
}

/* Gradient blob decorations */
.decoration-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

/* Scanline decorations */
.decoration-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Accent line decorations */
.decoration-accent-line {
    position: absolute;
    pointer-events: none;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .decoration-blob,
    .decoration-scanlines,
    .decoration-accent-line {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================
   Team Block
   ========================================== */
.block-team {
    padding: 16px 0;
}

.block-team .team-member {
    transition: transform 0.2s ease;
}

.block-team .team-member:hover {
    transform: translateY(-2px);
}

/* ==========================================
   Comparison Table Block
   ========================================== */
.block-comparison-table {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
}

.block-comparison-table table {
    border-collapse: collapse;
}

.block-comparison-table th,
.block-comparison-table td {
    padding: 12px 16px;
}

/* ==========================================
   Comparison Slider Block
   ========================================== */
.block-comparison-slider {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
}

.block-comparison-slider .slider-before {
    transition: none;
}

.block-comparison-slider .slider-divider {
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
