/**
 * Brunel Blocks Styles - Dark Mode
 * Custom Gutenberg blocks for LoadSys theme
 * Based on original Context Engineering Assistant design
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --brunel-bg-primary: #0a0e14;
    --brunel-bg-secondary: #111820;
    --brunel-bg-card: #161d27;
    --brunel-bg-highlight: #1a2332;
    --brunel-text-primary: #f0f4f8;
    --brunel-text-secondary: #8899a8;
    --brunel-text-muted: #5a6a78;
    --brunel-accent-green: #10b981;
    --brunel-accent-blue: #3b82f6;
    --brunel-accent-yellow: #fbbf24;
    --brunel-accent-red: #ef4444;
    --brunel-border-subtle: #1e2a3a;
}

/* ============================================
   Hero Content Block
   ============================================ */

.brunel-hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #0a0e14 0%, #111820 50%, #0f1419 100%);
    position: relative;
}

.brunel-hero::after {
    content: '';
    position: absolute;
    top: 20%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.brunel-hero__wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

/* Two-column layout when hero visual exists */
.brunel-hero__wrapper:has(.brunel-hero__visual) {
    grid-template-columns: 1.1fr 1fr;
}

.brunel-hero__content {
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Left-align content when visual is present */
.brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__content {
    text-align: left;
}

.brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__stats {
    justify-content: flex-start;
}

.brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__buttons {
    justify-content: flex-start;
}

.brunel-hero__visual {
    position: relative;
    z-index: 1;
}

.brunel-hero__visual-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px -20px rgba(16, 185, 129, 0.3);
}

.brunel-hero__headline {
    font-size: clamp(36px, 6vw, 56px);
    line-height: 1.2;
    margin-bottom: 24px;
    font-weight: 400;
    color: var(--brunel-text-primary);
}

.brunel-hero__headline .highlight {
    color: var(--brunel-accent-green);
    font-style: italic;
}

.brunel-hero__subheadline {
    font-size: 20px;
    line-height: 1.6;
    color: var(--brunel-text-secondary);
    margin-bottom: 40px;
}

/* Center layout (no visual) */
.brunel-hero__content:not(:has(~ .brunel-hero__visual)) .brunel-hero__subheadline {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.brunel-hero__stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.brunel-hero__stat {
    text-align: center;
}

.brunel-hero__stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--brunel-accent-green);
    line-height: 1;
    margin-bottom: 8px;
}

.brunel-hero__stat-label {
    font-size: 14px;
    color: var(--brunel-text-muted);
    text-transform: none;
}

.brunel-hero__buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ============================================
   Icon Card Grid Block
   ============================================ */

.brunel-icon-card-grid {
    padding: 4rem 0;
    background: var(--brunel-bg-secondary);
}

.brunel-icon-card-grid__header {
    margin-bottom: 5rem;
}

.brunel-icon-card-grid__header--center {
    text-align: center;
}

.brunel-icon-card-grid__header--left {
    text-align: left;
}

.brunel-icon-card-grid__eyebrow {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: var(--brunel-accent-green) !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
}

.brunel-icon-card-grid__heading {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 400 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-icon-card-grid__heading em {
    color: var(--brunel-accent-green) !important;
    font-style: italic !important;
}

.brunel-icon-card-grid__description {
    font-size: 1.125rem !important;
    color: var(--brunel-text-secondary) !important;
    max-width: 700px !important;
    line-height: 1.6 !important;
}

.brunel-icon-card-grid__header--center .brunel-icon-card-grid__description {
    margin-left: auto;
    margin-right: auto;
}

.brunel-icon-card-grid__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.brunel-icon-card-grid__card {
    padding: 32px;
    background: var(--brunel-bg-card);
    border-radius: 16px;
    border: 1px solid var(--brunel-border-subtle);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.brunel-icon-card-grid__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--brunel-accent-red);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.brunel-icon-card-grid__card:hover {
    transform: translateY(-4px);
    border-color: var(--brunel-accent-red);
}

.brunel-icon-card-grid__card:hover::before {
    opacity: 1;
}

.brunel-icon-card-grid__card--highlighted {
    background: var(--brunel-bg-highlight);
    border-color: var(--brunel-accent-green);
}

.brunel-icon-card-grid__card--highlighted::before {
    background: linear-gradient(135deg, var(--brunel-accent-green), var(--brunel-accent-blue));
}

.brunel-icon-card-grid__card--highlighted:hover::before {
    opacity: 1;
}

.brunel-icon-card-grid__card--warning {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--brunel-accent-red);
}

.brunel-icon-card-grid__card-icon {
    width: 56px;
    height: 56px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px !important;
    color: var(--brunel-accent-red);
    margin-bottom: 20px;
}

.brunel-icon-card-grid__card-icon i {
    font-size: 35px !important;
}

.brunel-icon-card-grid__card--highlighted .brunel-icon-card-grid__card-icon {
    background: linear-gradient(135deg, var(--brunel-accent-green), var(--brunel-accent-blue));
    color: var(--brunel-text-primary);
}

.brunel-icon-card-grid__card-title {
    font-size: 22px !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    line-height: 1.3 !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-icon-card-grid__card-content {
    font-size: 16px !important;
    line-height: 1.7 !important;
    color: var(--brunel-text-secondary) !important;
    margin: 0 !important;
}

/* ============================================
   Process Steps Block
   ============================================ */

.brunel-process-steps {
    padding: 4rem 0;
    background: var(--brunel-bg-primary);
}

.brunel-process-steps__header {
    margin-bottom: 5rem;
}

.brunel-process-steps__header--center {
    text-align: center;
}

.brunel-process-steps__header--left {
    text-align: left;
}

.brunel-process-steps__eyebrow {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: var(--brunel-accent-green) !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
}

.brunel-process-steps__heading {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 400 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-process-steps__heading em {
    color: var(--brunel-accent-green) !important;
    font-style: italic !important;
}

.brunel-process-steps__description {
    font-size: 1.125rem !important;
    color: var(--brunel-text-secondary) !important;
    max-width: 700px !important;
    line-height: 1.6 !important;
}

.brunel-process-steps__header--center .brunel-process-steps__description {
    margin-left: auto;
    margin-right: auto;
}

.brunel-process-steps__steps {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.brunel-process-steps__step {
    flex: 1;
    text-align: center;
    padding: 40px 32px;
    position: relative;
    background: var(--brunel-bg-card);
    border: 1px solid var(--brunel-border-subtle);
    transition: all 0.3s ease;
}

.brunel-process-steps__step:first-child {
    border-radius: 16px 0 0 16px;
}

.brunel-process-steps__step:last-child {
    border-radius: 0 16px 16px 0;
}

.brunel-process-steps__step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--brunel-text-muted);
    z-index: 10;
    background: var(--brunel-bg-primary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.brunel-process-steps__step:hover {
    background: var(--brunel-bg-highlight);
}

.brunel-process-steps__badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.brunel-process-steps__badge--default {
    background-color: var(--brunel-text-muted);
    color: var(--brunel-bg-primary);
}

.brunel-process-steps__badge--green {
    background-color: var(--brunel-accent-green);
    color: var(--brunel-bg-primary);
}

.brunel-process-steps__badge--yellow {
    background-color: var(--brunel-accent-yellow);
    color: var(--brunel-bg-primary);
}

.brunel-process-steps__badge--blue {
    background-color: var(--brunel-accent-blue);
    color: #ffffff;
}

.brunel-process-steps__badge--red {
    background-color: var(--brunel-accent-red);
    color: #ffffff;
}

.brunel-process-steps__step-title {
    font-size: 20px !important;
    font-weight: 600 !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-process-steps__step-description {
    font-size: 15px !important;
    line-height: 1.7 !important;
    color: var(--brunel-text-secondary) !important;
    margin: 0 !important;
}

/* ============================================
   Stats Grid Block
   ============================================ */

.brunel-stats-grid {
    padding: 4rem 0;
    background: var(--brunel-bg-secondary);
}

.brunel-stats-grid__stats {
    display: grid;
    gap: 32px;
    text-align: center;
}

.brunel-stats-grid__stats--cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.brunel-stats-grid__stats--cols-3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.brunel-stats-grid__stats--cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.brunel-stats-grid__stat {
    padding: 40px 24px;
    background: var(--brunel-bg-card);
    border: 1px solid var(--brunel-border-subtle);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.brunel-stats-grid__stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, var(--brunel-accent-green), var(--brunel-accent-blue));
}

.brunel-stats-grid__stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(16, 185, 129, 0.3);
}

.brunel-stats-grid__stat-number {
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brunel-accent-green), var(--brunel-accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

.brunel-stats-grid__stat-label {
    font-size: 18px;
    color: var(--brunel-text-secondary);
    font-weight: 400;
    margin-bottom: 8px;
}

.brunel-stats-grid__stat-sublabel {
    font-size: 13px;
    color: var(--brunel-text-muted);
}

/* ============================================
   Section Header Block
   ============================================ */

.brunel-section-header {
    padding: 4rem 0 !important;
    margin: 0 !important;
    background: var(--brunel-bg-secondary) !important;
}

.brunel-section-header--center {
    text-align: center !important;
}

.brunel-section-header--left {
    text-align: left !important;
}

.brunel-section-header__content {
    max-width: 900px !important;
    padding: 0 !important;
}

.brunel-section-header--center .brunel-section-header__content {
    margin-left: auto !important;
    margin-right: auto !important;
}

.brunel-section-header__eyebrow {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: var(--brunel-accent-green) !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
    display: block !important;
}

.brunel-section-header__heading {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 400 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-section-header__heading em {
    color: var(--brunel-accent-green) !important;
    font-style: italic !important;
}

.brunel-section-header__description {
    font-size: 1.125rem !important;
    line-height: 1.6 !important;
    color: var(--brunel-text-secondary) !important;
    margin: 0 !important;
    max-width: 700px !important;
}

.brunel-section-header--center .brunel-section-header__description {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ============================================
   CTA Block
   ============================================ */

.brunel-cta {
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--brunel-bg-secondary);
}

.brunel-cta--default {
    background: var(--brunel-bg-secondary);
}

.brunel-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.brunel-cta--gradient {
    background: linear-gradient(135deg, var(--brunel-bg-primary) 0%, var(--brunel-bg-secondary) 100%);
}

.brunel-cta--solid {
    background: var(--brunel-bg-primary);
}

.brunel-cta--spacing-normal {
    padding: 3rem 0;
}

.brunel-cta--spacing-large {
    padding: 4rem 0;
}

.brunel-cta--spacing-xlarge {
    padding: 5rem 0;
}

.brunel-cta__content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.brunel-cta__headline {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 400;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--brunel-text-primary);
}

.brunel-cta__headline .highlight {
    color: var(--brunel-accent-green);
    font-style: italic;
}

.brunel-cta__description {
    font-size: 20px;
    line-height: 1.6;
    color: var(--brunel-text-secondary);
    margin-bottom: 32px;
}

.brunel-cta__button {
    margin-top: 32px;
}

/* ============================================
   Button Styles
   ============================================ */

.btn {
    display: inline-block;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn--primary {
    background-color: var(--brunel-accent-green);
    color: var(--brunel-bg-primary);
}

.btn--primary:hover {
    background-color: #34d399;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(16, 185, 129, 0.4);
}

.btn--secondary {
    background-color: transparent;
    color: var(--brunel-text-primary);
    border: 1px solid var(--brunel-border-subtle);
}

.btn--secondary:hover {
    background-color: var(--brunel-bg-card);
    border-color: var(--brunel-text-muted);
}

.btn--large {
    padding: 18px 48px;
    font-size: 20px;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media screen and (max-width: 1024px) {
    .brunel-hero__wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .brunel-hero__wrapper:has(.brunel-hero__visual) {
        grid-template-columns: 1fr;
    }

    .brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__content {
        text-align: center;
    }

    .brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__stats {
        justify-content: center;
    }

    .brunel-hero__wrapper:has(.brunel-hero__visual) .brunel-hero__buttons {
        justify-content: center;
    }

    .brunel-hero__visual {
        display: none; /* Hide visual on tablets and mobile */
    }

    .brunel-hero__headline {
        font-size: 40px;
    }

    .brunel-hero__subheadline {
        font-size: 18px;
    }

    .brunel-hero__stats {
        gap: 32px;
    }

    .brunel-hero__stat-number {
        font-size: 36px;
    }

    .brunel-hero__buttons {
        flex-direction: column;
    }

    .brunel-icon-card-grid__heading,
    .brunel-process-steps__heading,
    .brunel-section-header__heading {
        font-size: 36px;
    }

    .brunel-icon-card-grid__eyebrow,
    .brunel-process-steps__eyebrow,
    .brunel-section-header__eyebrow {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .brunel-icon-card-grid__description,
    .brunel-process-steps__description,
    .brunel-section-header__description {
        font-size: 18px;
    }

    .brunel-section-header__content {
        padding: 0;
    }

    .brunel-icon-card-grid__cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .brunel-process-steps__steps {
        flex-direction: column;
        gap: 16px;
    }

    .brunel-process-steps__step {
        border-radius: 12px !important;
    }

    .brunel-process-steps__step:not(:last-child)::after {
        display: none;
    }

    .brunel-stats-grid__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .brunel-stats-grid__stat-number {
        font-size: 48px;
    }

    .brunel-cta__headline {
        font-size: 36px;
    }

    .brunel-cta__description {
        font-size: 18px;
    }
}

@media screen and (max-width: 640px) {
    .brunel-hero__stats {
        flex-direction: column;
        gap: 24px;
    }

    .brunel-hero__buttons {
        flex-direction: column;
    }

    .brunel-icon-card-grid__cards {
        grid-template-columns: 1fr;
    }

    .brunel-stats-grid__stats {
        grid-template-columns: 1fr;
    }

    .brunel-cta__headline {
        font-size: 28px;
    }

    .brunel-cta__description {
        font-size: 16px;
    }

    .brunel-icon-card-grid__heading,
    .brunel-process-steps__heading,
    .brunel-section-header__heading {
        font-size: 28px;
    }

    .brunel-icon-card-grid__description,
    .brunel-process-steps__description,
    .brunel-section-header__description {
        font-size: 16px;
    }

    .brunel-section-header__content {
        padding: 0;
    }

    .brunel-icon-card-grid__card-title {
        font-size: 20px;
    }

    .brunel-icon-card-grid__card-content {
        font-size: 15px;
    }
}

/* ============================================
   Brunel Featured Video Block
   ============================================ */

.brunel-featured-video {
    padding: 4rem 0;
    width: 100%;
    background: var(--brunel-bg-secondary);
}

/* Header Styles */
.brunel-featured-video__header {
    margin-bottom: 5rem;
}

.brunel-featured-video__header--center {
    text-align: center;
}

.brunel-featured-video__header--left {
    text-align: left;
}

.brunel-featured-video__eyebrow {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    color: var(--brunel-accent-green) !important;
    font-weight: 600 !important;
    margin-bottom: 1rem !important;
}

.brunel-featured-video__heading {
    font-size: clamp(2rem, 4vw, 3rem) !important;
    font-weight: 400 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
    color: var(--brunel-text-primary) !important;
}

.brunel-featured-video__heading em {
    color: var(--brunel-accent-green) !important;
    font-style: italic !important;
}

.brunel-featured-video__description {
    font-size: 1.125rem !important;
    color: var(--brunel-text-secondary) !important;
    max-width: 700px !important;
    line-height: 1.6 !important;
}

.brunel-featured-video__header--center .brunel-featured-video__description {
    margin-left: auto;
    margin-right: auto;
}

/* Section Heading */
.brunel-featured-video__heading {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 3rem;
    text-align: center;
    color: #1a1a1a;
}

/* Video Grid */
.brunel-featured-video__videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
    gap: 1.5rem;
    padding: 0 1.5rem;
    justify-content: center;
}

/* Individual Video Container */
.brunel-featured-video__video {
    width: 100%;
}

/* 16:9 Aspect Ratio Container */
.brunel-featured-video__iframe {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 = 9/16 = 0.5625 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background-color: #000000;
}

.brunel-featured-video__iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive Breakpoints */

/* Desktop: 2 columns at 992-1199px */
@media (max-width: 1199px) {
    .brunel-featured-video__videos {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Tablet: 2 columns */
@media (max-width: 991px) {
    .brunel-featured-video__heading {
        font-size: 36px;
    }

    .brunel-featured-video__eyebrow {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .brunel-featured-video__description {
        font-size: 18px;
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .brunel-featured-video {
        padding: 3rem 0;
    }

    .brunel-featured-video__heading {
        font-size: 28px;
    }

    .brunel-featured-video__description {
        font-size: 16px;
    }

    .brunel-featured-video__videos {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 0 1rem;
    }
}
