/*
 * Nexa Builder — Base Styles
 */

html, body { overflow-x: hidden; }

/* Central font reset */
.nexa-blocks-container {
    font-family: var(--nexa-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}
.nexa-blocks-container h1,.nexa-blocks-container h2,.nexa-blocks-container h3,
.nexa-blocks-container h4,.nexa-blocks-container h5,.nexa-blocks-container h6,
.nexa-blocks-container p,.nexa-blocks-container a,.nexa-blocks-container li,
.nexa-blocks-container span,.nexa-blocks-container button,.nexa-blocks-container input,
.nexa-blocks-container label,.nexa-blocks-container select,.nexa-blocks-container textarea {
    font-family: var(--nexa-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

/* --- Design tokens --- */
:root {
    --nx-accent:     var(--nexa-accent-color, var(--nexa-global-accent-color, #2563eb));
    --nx-text:       #0d1117;
    --nx-muted:      #6b7280;
    --nx-border:     #e5e7eb;
    --nx-bg:         #ffffff;
    --nx-bg-subtle:  #f9fafb;
    --nx-bg-dark:    #0d1117;
    --nx-radius:     10px;
    --nx-radius-sm:  6px;
    --nx-shadow-sm:  0 1px 2px rgba(0,0,0,.05);
    --nx-shadow:     0 4px 16px rgba(0,0,0,.07);
    --nx-shadow-lg:  0 20px 56px rgba(0,0,0,.13);
    --nx-ease:       cubic-bezier(.16,1,.3,1);
    --nx-duration:   0.3s;
    /* Legacy aliases for older templates */
    --nexa-accent:       var(--nx-accent);
    --nexa-text:         var(--nx-text);
    --nexa-text-muted:   var(--nx-muted);
    --nexa-border:       var(--nx-border);
    --nexa-bg-light:     var(--nx-bg-subtle);
    --nexa-radius:       var(--nx-radius);
    --nexa-radius-sm:    var(--nx-radius-sm);
    --nexa-shadow:       var(--nx-shadow-sm);
    --nexa-shadow-md:    var(--nx-shadow);
    --nexa-transition:   var(--nx-duration) ease;
}

/* --- Container --- */
.nexa-container {
    width: 100%; padding-right: 24px; padding-left: 24px;
    margin-right: auto; margin-left: auto;
}
@media (min-width: 576px)  { .nexa-container { max-width: 540px; } }
@media (min-width: 768px)  { .nexa-container { max-width: 720px; } }
@media (min-width: 992px)  { .nexa-container { max-width: 960px; } }
@media (min-width: 1200px) { .nexa-container { max-width: 1200px; } }

.nexa-container-fluid { width: 100%; padding-right: 24px; padding-left: 24px; margin-right: auto; margin-left: auto; }
.nexa-container-fluid--no-padding { padding-right: 0; padding-left: 0; }

/* --- Legacy Bootstrap grid (used by a few blocks) --- */
.row { display:flex; flex-wrap:wrap; margin-right:-15px; margin-left:-15px; }
.col-md-4,.col-md-6 { position:relative; width:100%; padding-right:15px; padding-left:15px; }
@media (min-width: 768px) {
    .col-md-4 { flex:0 0 33.333333%; max-width:33.333333%; }
    .col-md-6 { flex:0 0 50%; max-width:50%; }
    .offset-md-3 { margin-left:25%; }
}
.justify-content-center { justify-content:center !important; }

/* --- Nexa Flex Grid --- */
.nexa-row-flex { display:flex; flex-wrap:wrap; gap:20px; justify-content:flex-start; }
.nexa-col-4,.nexa-col-6,.nexa-col-3,.nexa-col-5th {
    flex-grow:1; flex-basis:auto; max-width:100%; box-sizing:border-box;
}
@media (min-width: 768px) {
    .nexa-col-4  { flex:0 0 calc(33.333% - 14px); max-width:calc(33.333% - 14px); }
    .nexa-col-6  { flex:0 0 calc(50% - 10px);    max-width:calc(50% - 10px); }
    .nexa-col-3  { flex:0 0 calc(25% - 15px);    max-width:calc(25% - 15px); }
    .nexa-col-5th{ flex:0 0 calc(20% - 16px);    max-width:calc(20% - 16px); }
}

/* --- Buttons --- */
.nexa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-weight: 600;
    font-size: .9375rem;
    line-height: 1;
    padding: .75rem 1.75rem;
    border-radius: var(--nx-radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--nx-duration) var(--nx-ease);
    letter-spacing: -.01em;
    white-space: nowrap;
}
.nexa-btn-primary {
    background: var(--nx-accent);
    border-color: var(--nx-accent);
    color: #fff;
}
.nexa-btn-primary:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
    color: #fff;
}
.nexa-btn-outline {
    background: transparent;
    border-color: var(--nx-accent);
    color: var(--nx-accent);
}
.nexa-btn-outline:hover {
    background: var(--nx-accent);
    color: #fff;
}
.nexa-btn-danger { background:#dc3545; border-color:#dc3545; color:#fff; }

/* --- Swiper accent --- */
.swiper-button-next,.swiper-button-prev { color:var(--nx-accent); }
.swiper-pagination-bullet-active { background:var(--nx-accent); }

/* --- Spacing utilities --- */
.pt-none { padding-top:0 !important; } .pt-s { padding-top:24px !important; }
.pt-m { padding-top:56px !important; } .pt-l { padding-top:96px !important; }
.pt-xl { padding-top:140px !important; }
.pb-none { padding-bottom:0 !important; } .pb-s { padding-bottom:24px !important; }
.pb-m { padding-bottom:56px !important; } .pb-l { padding-bottom:96px !important; }
.pb-xl { padding-bottom:140px !important; }

@media (max-width:767px) {
    .nexa-hidden-mobile { display:none !important; }
    .pt-l  { padding-top:56px !important; }
    .pb-l  { padding-bottom:56px !important; }
    .pt-xl { padding-top:80px !important; }
    .pb-xl { padding-bottom:80px !important; }
}
@media (min-width:768px) { .nexa-hidden-desktop { display:none !important; } }

/* --- Block flash (editor) --- */
@keyframes nexa-block-flash {
    0%   { box-shadow:0 0 0 3px rgba(37,99,235,.7); }
    100% { box-shadow:0 0 0 0 rgba(37,99,235,0); }
}
.nexa-block-updated { animation:nexa-block-flash 1.5s ease-out forwards; }

/* --- Shared empty state --- */
.nexa-dynamic-empty {
    text-align:center; padding:4rem 2rem;
    color:var(--nx-muted); font-size:.9375rem;
    border:2px dashed var(--nx-border);
    border-radius:var(--nx-radius);
    background:var(--nx-bg-subtle);
}

/* Block-specific styles live in each template's style.css */
