/* ════════════════════════════════════════════════════════
   StyleCanvas — Frontend Styles
   Applied to all pages/posts rendered by our page template
   ════════════════════════════════════════════════════════ */

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.sc-page {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
                 Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* ── Page content wrapper ───────────────────────────────── */
#sc-page-content {
    overflow: hidden;
}

/* ── Sections ───────────────────────────────────────────── */
.sc-section { width: 100%; }
.sc-section--full > .sc-section-inner { max-width: 100%; }

.sc-section-inner {
    max-width: var(--sc-content-w, 1200px);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    padding: 0 24px;
    /* Inherit the section's min-height so columns (and vertical alignment of
       their widgets) can fill the available height. */
    min-height: inherit;
}

/* Full-width page: content spans 100%, edge to edge (no cap, no side padding) */
.sc-page-wrap--full .sc-section-inner {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}
/* Drop the column side gutter on full-width pages (CSS so it never depends on
   the inline render — survives cache/version differences). */
.sc-page-wrap--full > .sc-section > .sc-section-inner > .sc-column {
    padding-left: 0;
    padding-right: 0;
}

/* ── Columns ────────────────────────────────────────────── */
.sc-column {
    display: flex;
    flex-direction: column;
    padding: 12px;
}
/* Inner fills the (equal-height) column so widgets can vertically align. */
.sc-column > .sc-col-inner { flex: 1 1 auto; display: flex; flex-direction: column; }

@media (max-width: 768px) {
    .sc-column { width: 100% !important; }
    .sc-section-inner { flex-direction: column; }
}

/* ── Widget base ────────────────────────────────────────── */
.sc-widget { word-break: break-word; }

/* ── Section / column backgrounds + overlays ────────────── */
.sc-section, .sc-column { position: relative; }
.sc-section > .sc-overlay, .sc-column > .sc-overlay {
    position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.sc-section > .sc-section-inner { position: relative; z-index: 1; }
.sc-column > .sc-col-inner { position: relative; z-index: 1; }
.sc-col-link { display: block; color: inherit; text-decoration: none; }
.sc-section-link { color: inherit; text-decoration: none; }

/* ── Gallery ────────────────────────────────────────────── */
.sc-gallery-item { overflow: hidden; }
.sc-gallery--carousel { position: relative; }
.sc-gallery-viewport { overflow: hidden; }
.sc-gallery-track { display: flex; gap: var(--sc-gap, 10px); transition: transform .4s ease; }
.sc-gallery-prev, .sc-gallery-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: none; border-radius: 50%; padding: 0;
    background: rgba(0,0,0,.5); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; z-index: 2;
}
.sc-gallery-prev i, .sc-gallery-next i { line-height: 1; }
.sc-gallery-prev { left: 8px; } .sc-gallery-next { right: 8px; }
.sc-gallery-prev:hover, .sc-gallery-next:hover { background: rgba(0,0,0,.75); }
/* Arrows outside the images (sit in the carousel's side padding). */
.sc-gallery--arrows-outside { padding: 0 48px; }
.sc-gallery--arrows-outside .sc-gallery-prev { left: 2px; }
.sc-gallery--arrows-outside .sc-gallery-next { right: 2px; }
.sc-gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.sc-gallery-dots button { width: 10px; height: 10px; padding: 0; border: none; border-radius: 50%; background: #ccc; cursor: pointer; }
.sc-gallery-dots button.sc-active { background: #555; }
/* Bullets over the images. */
.sc-gallery--bullets-inside .sc-gallery-dots { position: absolute; left: 0; right: 0; bottom: 10px; margin: 0; }
.sc-gallery--bullets-inside .sc-gallery-dots button { background: rgba(255,255,255,.65); }
.sc-gallery--bullets-inside .sc-gallery-dots button.sc-active { background: #fff; }
.sc-gallery-caption { padding: 6px 4px; font-size: 13px; text-align: center; }
.sc-gallery.sc-placeholder, .sc-code.sc-placeholder, .sc-table.sc-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 40px; background: #f3f4f6; color: #999; border-radius: 6px;
}

/* ── Table ──────────────────────────────────────────────── */
.sc-table { max-width: 100%; }
.sc-table table { margin: 0; }
.sc-table th, .sc-table td { word-break: break-word; }

/* ── Code Snippet ───────────────────────────────────────── */
.sc-code { position: relative; }
.sc-code pre { margin: 0; border-radius: 6px; }
.sc-code-copy {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3);
    border-radius: 4px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.sc-code-copy:hover { background: rgba(255,255,255,.28); }

/* ── Custom button ──────────────────────────────────────── */
.sc-btn--custom {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; text-decoration: none; cursor: pointer;
    background: #4f9ef8; color: #fff; border-radius: 4px; line-height: 1.2;
    transition: opacity .15s, transform .05s, box-shadow .15s;
}
.sc-btn--custom:hover { opacity: .92; }
.sc-btn--custom:active { transform: translateY(1px); }
.sc-btn--custom .dashicons, .sc-btn--custom i { font-size: 18px; width: 18px; height: 18px; line-height: 1; }

/* ── Image hover overlay ────────────────────────────────── */
.sc-img-wrap { position: relative; display: inline-block; line-height: 0; }
.sc-img-hover {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0); opacity: 0; transition: opacity .25s, background .25s; color: #fff;
}
.sc-img-wrap:hover .sc-img-hover { opacity: 1; background: rgba(0,0,0,.45); }
.sc-img-hover .dashicons, .sc-img-hover i { font-size: 38px; width: 38px; height: 38px; }

/* ── Lightbox ───────────────────────────────────────────── */
.sc-lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.85);
    display: none; align-items: center; justify-content: center; z-index: 100000;
}
.sc-lightbox-overlay.sc-open { display: flex; }
.sc-lightbox-img { max-width: 92vw; max-height: 92vh; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.sc-lightbox-close {
    position: absolute; top: 18px; right: 24px; background: none; border: none;
    color: #fff; font-size: 40px; line-height: 1; cursor: pointer;
}

/* ── Sticky header ──────────────────────────────────────── */
.sc-site-header--sticky.sc-stuck {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
    box-shadow: 0 2px 14px rgba(0,0,0,.12);
}
body.admin-bar .sc-site-header--sticky.sc-stuck { top: 32px; }
.sc-site-header--transparent:not(.sc-stuck) .sc-section { background-color: transparent !important; }
.sc-site-header--transparent:not(.sc-stuck) .sc-section > .sc-overlay { opacity: 0; }

/* ── Heading ────────────────────────────────────────────── */
.sc-widget--heading .sc-heading {
    margin: 0 0 .5em;
    line-height: 1.2;
}

/* ── Text ───────────────────────────────────────────────── */
.sc-widget--text .sc-text p:last-child { margin-bottom: 0; }

/* ── Button ─────────────────────────────────────────────── */
.sc-button-wrap { padding: 4px 0; }

.sc-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .18s;
    line-height: 1;
}

/* Primary */
.sc-btn--primary {
    background: #4f9ef8;
    color: #fff;
    border-color: #4f9ef8;
}
.sc-btn--primary:hover { background: #3a8ae8; border-color: #3a8ae8; }

/* Secondary */
.sc-btn--secondary {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}
.sc-btn--secondary:hover { background: #5a6268; border-color: #5a6268; }

/* Outline */
.sc-btn--outline {
    background: transparent;
    color: #4f9ef8;
    border-color: #4f9ef8;
}
.sc-btn--outline:hover { background: #4f9ef8; color: #fff; }

/* Link style */
.sc-btn--link {
    background: transparent;
    color: #4f9ef8;
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
    text-decoration: underline;
}
.sc-btn--link:hover { color: #3a8ae8; }

/* Sizes */
.sc-btn--sm { padding: 6px 16px; font-size: 13px; }
.sc-btn--md { padding: 10px 24px; font-size: 15px; }
.sc-btn--lg { padding: 14px 32px; font-size: 17px; }

/* Full width */
.sc-btn--full { display: block; width: 100%; text-align: center; }

/* ── Image ──────────────────────────────────────────────── */
.sc-widget--image .sc-image { padding: 4px 0; }
.sc-widget--image .sc-img { max-width: 100%; height: auto; display: inline-block; }
.sc-widget--image .sc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #f5f7fa;
    border: 2px dashed #cdd5df;
    border-radius: 6px;
    color: #aab;
    gap: 8px;
    font-size: 14px;
}
.sc-widget--image .sc-placeholder .dashicons { font-size: 36px; width: 36px; height: 36px; }

/* ── Video ──────────────────────────────────────────────── */
.sc-video { padding: 4px 0; }
.sc-video-ratio { position: relative; }
.sc-video-ratio iframe,
.sc-video-ratio video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.sc-video.sc-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #1a1a2e;
    border-radius: 6px;
    color: #aab;
    gap: 10px;
    font-size: 14px;
}
.sc-video.sc-placeholder .dashicons { font-size: 40px; width: 40px; height: 40px; color: #4f9ef8; }

/* ── Divider ────────────────────────────────────────────── */
.sc-divider { padding: 4px 0; overflow: hidden; }

/* ── Spacer ─────────────────────────────────────────────── */
.sc-spacer { display: block; }

/* ── Empty state (no content + admin) ──────────────────── */
.sc-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex-direction: column;
    gap: 14px;
    color: #aab;
}
.sc-empty-state p { font-size: 16px; }
.sc-empty-btn {
    display: inline-block;
    background: #4f9ef8;
    color: #fff;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: background .15s;
}
.sc-empty-btn:hover { background: #3a8ae8; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .sc-section-inner { max-width: 100%; }
}

@media (max-width: 768px) {
    body.logged-in.sc-page { padding-top: 60px; }
    #sc-frontend-bar { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 8px; }
    .sc-btn--lg { padding: 12px 24px; font-size: 15px; }
    .sc-section-inner { padding: 0 16px; }
}
