/* ==========================================================================
   B&M Migration Stylesheet
   Clean layout classes for migrated WPBakery content.
   Works alongside the existing #bm-content design system.
   ========================================================================== */

:root {
    --bm-navy: #222d56;
    --bm-navy-light: #3b4a7a;
    --bm-green: #52ae32;
    --bm-white: #ffffff;
    --bm-gray-light: #f5f5f5;
    --bm-text: #2d2d2d;
    --bm-container: 1200px;
    --bm-gap: 2rem;
}

/* ── Breakout mixin (break out of theme container) ─────────────────────── */

.bm-breakout {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

/* ── Layout ────────────────────────────────────────────────────────────── */

.bm-section {
    max-width: var(--bm-container);
    margin-inline: auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 1;
}

.bm-section--full {
    max-width: none;
    padding-inline: 1.5rem;
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

.bm-section--dark {
    background-color: var(--bm-navy);
    color: var(--bm-white);
    max-width: none;
    padding: 3rem 1.5rem;
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

.bm-section--dark,
.bm-section--dark * {
    color: var(--bm-white) !important;
}

.bm-section--dark a {
    color: var(--bm-white) !important;
    text-decoration: underline;
}

.bm-section--pad-bottom-lg { padding-bottom: 4rem; }
.bm-section--pad-bottom-xl { padding-bottom: 8rem; }
.bm-section--pad-top-lg    { padding-top: 4rem; }

.bm-section--overlap {
    margin-top: -8rem;
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

.bm-row {
    display: grid;
    gap: var(--bm-gap);
    align-items: start;
    max-width: var(--bm-container);
    margin-inline: auto;
}

/* Column layout presets */
.bm-row--2col  { grid-template-columns: 1fr 1fr; }
.bm-row--3col  { grid-template-columns: 1fr 1fr 1fr; }
.bm-row--4col  { grid-template-columns: repeat(4, 1fr); }

/* Vertically center columns when parent row uses content_placement="middle" */
.bm-row--middle {
    align-items: center;
}

/* ── Utility classes ──────────────────────────────────────────────────── */

.bm-text-center { text-align: center; }
.bm-text-left   { text-align: left; }
.bm-text-dark   { color: var(--bm-text); }
.bm-text-white  { color: var(--bm-white); }
.bm-max-800     { max-width: 800px; margin-inline: auto; }

/* ── Raw HTML component classes (from vc_raw_html blocks) ─────────────── */

.bm-badge-green {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #27ae60;
    color: var(--bm-white);
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: bold;
}

.bm-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,0.92);
}

.bm-feature-label {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.bm-cta-block {
    background: #e67e22;
    color: var(--bm-white);
    padding: 32px 36px;
    border-radius: 12px;
    margin: 32px 0;
    text-align: center;
}

.bm-info-block {
    background: #1a1a2e;
    color: var(--bm-white);
    padding: 48px 40px;
    margin: 48px 0;
    border-radius: 12px;
}

.bm-callout {
    background: #eef4fb;
    border-left: 4px solid var(--bm-navy-light);
    padding: 24px 28px;
    border-radius: 0 8px 8px 0;
    margin: 28px 0;
}

.bm-tip-block {
    margin: 48px 0 32px;
    padding: 32px;
    background: #f0eeeb;
    border-radius: 12px;
}

.bm-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin: 0 0 32px 0;
}

.bm-btn-cta {
    display: inline-block;
    background: #e67e22;
    color: var(--bm-white);
    padding: 16px 36px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.0625rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.bm-btn-cta-outline {
    display: inline-block;
    background: var(--bm-white);
    color: #e67e22;
    padding: 14px 36px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.0625rem;
    text-decoration: none;
}

/* ── Hero ──────────────────────────────────────────────────────────────── */

.bm-hero {
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--bm-white);
    text-align: center;
    overflow: hidden;
}

.bm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(34, 45, 86, 0.7) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
}

.bm-hero__content {
    position: relative;
    z-index: 2;
    max-width: var(--bm-container);
    padding: 4rem 1.5rem;
}

.bm-hero__title {
    font-size: 2.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--bm-white);
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bm-hero__subtitle {
    font-size: 1.5rem;
    margin: 0;
    opacity: 0.9;
    font-style: italic;
}

.bm-hero__cta {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: var(--bm-green);
    color: var(--bm-white);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    text-align: center;
    min-width: 260px;
}

.bm-hero__cta-label {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
    text-transform: uppercase;
}

.bm-hero__cta-phone {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bm-white) !important;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.bm-hero__cta-email {
    display: block;
    color: var(--bm-white) !important;
    text-decoration: underline;
    font-size: 0.95rem;
}

/* ── Images ────────────────────────────────────────────────────────────── */

.bm-img {
    margin: 0;
}

.bm-img img {
    max-width: 100%;
    height: auto;
    display: block;
}

.bm-img--center {
    text-align: center;
}

.bm-img--center img {
    margin-inline: auto;
}

/* ── Video ─────────────────────────────────────────────────────────────── */

.bm-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.bm-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Gallery ───────────────────────────────────────────────────────────── */

.bm-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    max-width: var(--bm-container);
    margin-inline: auto;
}

.bm-gallery--2col { grid-template-columns: repeat(2, 1fr); }
.bm-gallery--3col { grid-template-columns: repeat(3, 1fr); }
.bm-gallery--4col { grid-template-columns: repeat(4, 1fr); }
.bm-gallery--5col { grid-template-columns: repeat(5, 1fr); }
.bm-gallery--6col { grid-template-columns: repeat(6, 1fr); }

.bm-gallery__item {
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 4 / 3;
}

.bm-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.bm-gallery__item img:hover {
    transform: scale(1.03);
}

/* ── Logo Grid ─────────────────────────────────────────────────────────── */

.bm-logo-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 0;
}

.bm-logo-grid__item {
    max-height: 50px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.bm-logo-grid__item:hover {
    filter: none;
    opacity: 1;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.bm-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--bm-navy);
    color: var(--bm-white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s;
}

.bm-btn:hover {
    background: var(--bm-navy-light);
    color: var(--bm-white);
}

.bm-btn--warning  { background: #e67e22; }
.bm-btn--warning:hover { background: #d35400; }
.bm-btn--green    { background: var(--bm-green); }
.bm-btn--green:hover { background: #3d8c25; }
.bm-btn--danger   { background: #e74c3c; }
.bm-btn--info     { background: #3498db; }
.bm-btn--lg       { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* ── Separator ─────────────────────────────────────────────────────────── */

.bm-separator {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

.bm-separator--navy      { border-color: var(--bm-navy); }
.bm-separator--navy-light { border-color: var(--bm-navy-light); }

/* ── Toggle / Accordion / Expand ───────────────────────────────────────── */

.bm-toggle,
.bm-accordion__item,
.bm-expand {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.bm-toggle summary,
.bm-accordion__item summary,
.bm-expand summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.bm-toggle summary::marker,
.bm-accordion__item summary::marker,
.bm-expand summary::marker {
    display: none;
}

.bm-toggle summary::before,
.bm-accordion__item summary::before,
.bm-expand summary::before {
    content: '+';
    display: inline-block;
    width: 1.25em;
    font-weight: 700;
    color: var(--bm-navy);
}

.bm-toggle[open] summary::before,
.bm-accordion__item[open] summary::before,
.bm-expand[open] summary::before {
    content: '−';
}

.bm-toggle > div,
.bm-accordion__item > div,
.bm-expand > div {
    padding: 0 1.25rem 1rem;
}

.bm-accordion {
    display: flex;
    flex-direction: column;
}

/* ── Site-specific classes from the original theme ─────────────────────── */

/* Home page intro list in dark section */
.home-intro-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-intro-ul li {
    padding: 4px 0 !important;
    color: var(--bm-white);
    font-size: 1rem;
    background-image: none !important; /* Override theme's checkmark image */
}

.home-intro-ul li::before {
    content: '✓ ';
    color: var(--bm-green) !important;
    font-weight: 700;
}

.bm-section--dark .home-intro-ul li {
    color: var(--bm-white) !important;
}

.home-intro-ul li a {
    color: var(--bm-white);
}

/* Override theme li styling inside migrated dark sections */
.bm-section--dark ul li {
    background-image: none !important;
    padding-left: 0 !important;
}

/* Angled bottom edge for dark sections
   Override theme inline styles that use gradient-based diagonal + 600px padding */
.site-block-dark {
    padding-bottom: 4rem !important;
    margin-bottom: 2rem;
    background: var(--bm-navy) !important;
}

.site-block-dark::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -30px;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bm-navy);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: 2;
}

.site-block-dark-noskew::after {
    display: none;
}

.site-block-dark-slogan {
    text-align: center;
    padding: 3rem 1.5rem !important;
    padding-bottom: 3rem !important;
    background: var(--bm-navy) !important;
}

.site-block-dark-slogan::before {
    content: '';
    display: block;
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--bm-navy);
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
    z-index: 2;
}

.home-row-contact {
    background: linear-gradient(to bottom, transparent 50%, #f5f5f5 50%);
}

/* Contact block on dark background (green) */
.home-block-contact {
    background: var(--bm-green);
    color: var(--bm-white);
    padding: 2rem;
    border-radius: 8px 8px 0 0;
}

.home-block-contact h3,
.home-block-contact a {
    color: var(--bm-white);
}

.site-contact-form {
    background: var(--bm-green);
    padding: 0 2rem 2rem;
    border-radius: 0 0 8px 8px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .bm-row {
        grid-template-columns: 1fr !important;
    }

    .bm-hero {
        min-height: 300px;
    }

    .bm-hero__title {
        font-size: 1.75rem;
    }

    .bm-section {
        padding: 1.5rem 1rem;
    }

    .bm-logo-grid {
        gap: 1.5rem;
    }

    .bm-logo-grid__item {
        max-height: 40px;
    }
}
