/* SBC Showcase v0.1.2
   Light theme. Tier colors are configurable via Tier Badges admin;
   inline styles carry the color values so any tier renders with its own color.
*/

:root {
    --sbc-teal: #14747a;
    --sbc-teal-dark: #0f5c61;
    --sbc-teal-badge: #14747a;
    --sbc-border: #e0e0e0;
    --sbc-text: #333;
    --sbc-text-muted: #666;
    --sbc-bg: #fff;
    --sbc-bg-alt: #f9f9f9;
    /* Content width — matches the block theme's site container so plugin
       templates align with regular Pages. Adjust if the theme's width changes. */
    --sbc-content-width: 1280px;
}

.sbc-showcase-landing {
    max-width: var(--sbc-content-width);
    margin: 0 auto;
    padding: 24px 16px;
    color: var(--sbc-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- News feed ---------- */
.sbc-news h2 {
    color: var(--sbc-text);
    font-size: 28px;
    margin: 0 0 20px;
    border-bottom: 0;
}

.sbc-news-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--sbc-border);
    align-items: flex-start;
}

.sbc-news-item-image { flex: 0 0 180px; }
.sbc-news-item-image img {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}
.sbc-news-item-body { flex: 1; min-width: 0; }
.sbc-news-item-body h3 { margin: 0 0 8px; font-size: 20px; }
.sbc-news-item-body h3 a { color: var(--sbc-teal); text-decoration: underline; }
.sbc-news-item-body h3 a:hover { color: var(--sbc-teal-dark); }
.sbc-news-item-body p { margin: 12px 0 0; color: var(--sbc-text); font-size: 14px; line-height: 1.5; }

.sbc-more-news { text-align: right; padding: 12px 0 24px; }
.sbc-more-news a { color: var(--sbc-teal); font-weight: 600; text-decoration: underline; }

/* ---------- Badges ---------- */
.sbc-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 2px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #fff;
}
.sbc-badge-sponsored {
    background: var(--sbc-teal-badge);
    margin: 4px 0 8px;
}
.sbc-badge-tier {
    font-size: 10px;
    padding: 4px 12px;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    text-transform: uppercase;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
}

/* ---------- Directory grid ---------- */
.sbc-directory { margin-top: 32px; }
.sbc-directory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 900px) { .sbc-directory-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .sbc-directory-grid { grid-template-columns: 1fr; } }

.sbc-member-card {
    display: flex;
    flex-direction: column;
    background: var(--sbc-bg);
    border: 1px solid var(--sbc-border);
    border-radius: 4px;
    padding: 32px 16px 16px 16px; /* extra top padding for tier badge clearance */
    text-decoration: none;
    color: var(--sbc-text);
    min-height: 340px;
    position: relative;
    transition: box-shadow 0.15s ease-in-out;
}
.sbc-member-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
}
.sbc-member-card-highlighted { border-width: 2px; }

.sbc-member-card-logo {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sbc-bg);
    margin-bottom: 12px;
}
.sbc-member-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.sbc-member-card-body h4 {
    margin: 0 0 6px;
    font-size: 16px;
    color: var(--sbc-teal);
    font-weight: 700;
    line-height: 1.25;
}
.sbc-member-card:hover .sbc-member-card-body h4 { color: var(--sbc-teal-dark); }
.sbc-member-card-types { margin: 0; color: var(--sbc-text-muted); font-size: 13px; line-height: 1.4; }
.sbc-member-card-types-primary   { color: var(--sbc-text); font-weight: 600; margin: 6px 0 0; }
.sbc-member-card-types-secondary { color: var(--sbc-text-muted); font-style: italic; margin: 3px 0 0; }

/* ---------- Pagination ---------- */
.sbc-pagination { margin: 32px 0 16px; text-align: center; }
.sbc-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    color: var(--sbc-teal);
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 14px;
    border-radius: 2px;
}
.sbc-pagination .page-numbers.current {
    background: var(--sbc-teal);
    color: #fff;
    border-color: var(--sbc-teal);
}
.sbc-pagination .page-numbers:hover:not(.current) { background: var(--sbc-bg-alt); }

/* ---------- Profile page ---------- */
.sbc-profile {
    max-width: var(--sbc-content-width);
    margin: 0 auto;
    padding: 24px 0;
    color: var(--sbc-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.sbc-profile-header {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: var(--sbc-bg);
    border: 1px solid var(--sbc-border);
    border-radius: 4px;
    margin-bottom: 0;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sbc-profile-logo {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sbc-bg);
}

.sbc-profile-logo img {
    max-width: 220px;
    max-height: 220px;
    object-fit: contain;
    display: block;
}

.sbc-profile-info { flex: 1; min-width: 0; }

.sbc-profile-info h1 {
    margin: 0 0 12px;
    color: var(--sbc-text);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
}

.sbc-profile-address { margin: 4px 0; color: var(--sbc-text-muted); line-height: 1.5; }
.sbc-profile-meta   { margin: 8px 0; color: var(--sbc-text); }
.sbc-profile-meta strong { color: var(--sbc-text); }

.sbc-profile-badge {
    display: inline-block;
    padding: 6px 18px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.sbc-profile-socials {
    display: flex;
    gap: 10px;
    margin: 14px 0 0;
    align-items: center;
    flex-wrap: wrap;
}

.sbc-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sbc-social:hover {
    transform: translateY(-1px);
    opacity: 0.9;
    text-decoration: none;
    color: #fff;
}

.sbc-social svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

.sbc-social-linkedin  { background: #0A66C2; }
.sbc-social-x         { background: #000000; }
.sbc-social-facebook  { background: #1877F2; }
.sbc-social-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* ---------- Tabs ---------- */
.sbc-tabs { margin-top: 0; }

.sbc-tab-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    background: transparent;
    border: none;
    flex-wrap: wrap;
}

/* Each tab is a button with a number span and a label span, separated from
   the next by a horizontal line pseudo-element. */
.sbc-tab-nav button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 999px;
    padding: 10px 22px;
    cursor: pointer;
    color: var(--sbc-text);
    font-weight: 500;
    font-size: 16px;
    font-family: inherit;
    letter-spacing: 0;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
}
.sbc-tab-nav button:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    width: 12px;
    height: 1px;
    background: #d0d0d0;
    pointer-events: none;
}
.sbc-tab-num {
    font-size: 12px;
    font-weight: 600;
    color: #b0b0b0;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}
.sbc-tab-label {
    color: inherit;
}
.sbc-tab-nav button:hover {
    color: var(--sbc-teal);
}
.sbc-tab-nav button:hover .sbc-tab-num {
    color: var(--sbc-teal);
}
.sbc-tab-nav button.active {
    border-color: #b1263a; /* burgundy pill outline like main site */
    color: var(--sbc-text);
}
.sbc-tab-nav button.active .sbc-tab-num {
    color: #b1263a;
}
.sbc-tab-nav button.active .sbc-tab-label {
    font-weight: 500;
}

.sbc-tab-panel {
    display: none;
    padding: 24px;
    background: var(--sbc-bg);
    border: 1px solid var(--sbc-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.sbc-tab-panel.active { display: block; }

.sbc-tab-panel h3 {
    margin: 0 0 12px;
    color: var(--sbc-text);
    font-size: 18px;
    font-weight: 600;
}

.sbc-tab-panel h3:not(:first-child) { margin-top: 24px; }

.sbc-attr-value { margin: 0 0 8px; color: var(--sbc-text); line-height: 1.5; }

.sbc-attr-list {
    margin: 4px 0 12px;
    padding-left: 20px;
    color: var(--sbc-text);
    line-height: 1.6;
}

.sbc-blog-list { list-style: none; padding: 0; margin: 0; }
.sbc-blog-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--sbc-border);
}
.sbc-blog-item:last-child { border-bottom: 0; }
.sbc-blog-item h4 { margin: 0 0 4px; font-size: 16px; }
.sbc-blog-item h4 a { color: var(--sbc-teal); text-decoration: none; }
.sbc-blog-item h4 a:hover { text-decoration: underline; }
.sbc-blog-item .sbc-blog-meta { color: var(--sbc-text-muted); font-size: 12px; margin: 0 0 8px; }
.sbc-blog-item .sbc-blog-excerpt { color: var(--sbc-text); font-size: 14px; margin: 0; line-height: 1.5; }

.sbc-contact-info {
    background: var(--sbc-bg-alt);
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 24px;
}
.sbc-contact-info p { margin: 4px 0; }

/* ---------- Contact form ---------- */
.sbc-contact-note {
    background: #f0f7f8;
    border-left: 3px solid var(--sbc-teal);
    padding: 10px 14px;
    margin: 8px 0 16px;
    color: var(--sbc-text);
    font-size: 14px;
    line-height: 1.5;
    border-radius: 2px;
}

.sbc-contact-form label {
    display: block;
    margin: 12px 0;
    font-weight: 600;
    color: var(--sbc-text);
    font-size: 14px;
}
.sbc-contact-form input[type="text"],
.sbc-contact-form input[type="email"],
.sbc-contact-form input[type="tel"],
.sbc-contact-form textarea {
    display: block;
    width: 100%;
    max-width: 600px;
    padding: 8px 10px;
    margin-top: 4px;
    border: 1px solid var(--sbc-border);
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}
.sbc-contact-form textarea {
    min-height: 120px;
    resize: vertical;
}
.sbc-contact-form input:focus,
.sbc-contact-form textarea:focus {
    outline: 2px solid var(--sbc-teal);
    outline-offset: -1px;
    border-color: var(--sbc-teal);
}
.sbc-contact-form .g-recaptcha {
    margin: 12px 0;
}
.sbc-contact-hint {
    color: var(--sbc-text-muted);
    font-size: 13px;
    margin: 12px 0;
}
.sbc-contact-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.sbc-contact-submit {
    background: var(--sbc-teal);
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.sbc-contact-submit:hover:not(:disabled) { background: var(--sbc-teal-dark); }
.sbc-contact-submit:disabled { opacity: 0.6; cursor: wait; }
.sbc-contact-status {
    font-size: 14px;
    line-height: 1.4;
}
.sbc-contact-status-success { color: #2e7d32; }
.sbc-contact-status-error   { color: #b32d2e; }

/* ---------- Single post view (single-post.php) ---------- */
.sbc-single-post {
    max-width: none;
    margin: 0;
    padding: 0;
    color: var(--sbc-text);
    box-sizing: border-box;
}
.sbc-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin: 0 0 20px;
}
.sbc-badge-sponsored {
    display: inline-block;
    background: var(--sbc-teal);
    color: #fff;
    padding: 6px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1.4;
    align-self: flex-start;
    margin-top: 8px;
}
.sbc-post-title {
    font-size: 32px;
    line-height: 1.2;
    color: var(--sbc-text);
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.sbc-post-date {
    color: var(--sbc-muted, #666);
    font-size: 13px;
    margin: 16px 0 24px;
    font-style: italic;
}
.sbc-post-featured-image {
    margin: 0 0 8px;
    max-width: 100%;
    text-align: left;
}
.sbc-post-featured-image img {
    max-width: 100%;
    max-height: 520px;
    width: auto;
    height: auto;
    display: inline-block;
    border-radius: 4px;
    object-fit: contain;
}
.sbc-post-body p {
    margin: 0 0 16px;
    line-height: 1.6;
    font-size: 16px;
}
.sbc-post-body a {
    color: var(--sbc-teal);
    text-decoration: underline;
}
.sbc-post-body a:hover {
    color: var(--sbc-teal-dark);
}
/* Base image sizing — max 640px tall, contain proportions */
.sbc-post-body img {
    max-width: 100%;
    max-height: 640px;
    width: auto;
    height: auto;
    object-fit: contain;
}
/* WordPress standard alignment classes applied by the media modal */
.sbc-post-body img.alignleft,
.sbc-post-body .alignleft {
    float: left;
    margin: 8px 20px 12px 0;
}
.sbc-post-body img.alignright,
.sbc-post-body .alignright {
    float: right;
    margin: 8px 0 12px 20px;
}
.sbc-post-body img.aligncenter,
.sbc-post-body .aligncenter {
    display: block;
    margin: 12px auto;
    clear: both;
}
.sbc-post-body img.alignnone,
.sbc-post-body .alignnone {
    display: block;
    margin: 12px 0;
}
/* Default (no class) — treat as left aligned so images sit at the left margin */
.sbc-post-body img:not(.alignleft):not(.alignright):not(.aligncenter):not(.alignnone) {
    display: block;
    margin: 12px 20px 12px 0;
}
/* Clear floats at end of paragraphs so successive content stacks cleanly */
.sbc-post-body p::after {
    content: "";
    display: table;
    clear: both;
}
.sbc-post-body h2 { font-size: 24px; margin: 28px 0 12px; }
.sbc-post-body h3 { font-size: 20px; margin: 24px 0 10px; }
.sbc-post-body ul,
.sbc-post-body ol { margin: 0 0 16px 24px; line-height: 1.6; }
.sbc-post-body li { margin: 0 0 6px; }
.sbc-post-body blockquote {
    border-left: 4px solid var(--sbc-teal);
    padding: 4px 16px;
    margin: 16px 0;
    color: var(--sbc-muted, #666);
    font-style: italic;
}
.sbc-post-tags {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--sbc-border);
    color: var(--sbc-muted, #666);
    font-size: 13px;
}
.sbc-post-tags a {
    color: var(--sbc-teal);
    text-decoration: none;
    background: #f0f7f8;
    padding: 3px 10px;
    margin: 2px 4px 2px 0;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}
.sbc-post-tags a:hover {
    background: #e0eff1;
}

@media (max-width: 768px) {
    .sbc-single-post { padding: 16px 0; }
    .sbc-post-header {
        flex-direction: column;
        gap: 12px;
    }
    .sbc-badge-sponsored { margin-top: 0; align-self: flex-start; }
    .sbc-post-title { font-size: 24px; }
    .sbc-post-body p { font-size: 15px; }

    .sbc-profile { padding: 16px 20px; }
    .sbc-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    .sbc-profile-logo { flex: 0 0 auto; }
    .sbc-profile-info h1 { font-size: 24px; }
    .sbc-profile-socials { justify-content: center; }
    .sbc-tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 10px;
    }
    .sbc-tab-nav button {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 14px;
        gap: 8px;
    }
    .sbc-tab-nav button:not(:last-child)::after {
        right: -10px;
        width: 10px;
    }
    .sbc-tab-panel { padding: 16px; }
}

/* ---------- Theme integration ----------
   The custom "saferbuildings" theme uses #page as its outermost wrapper.
   Historically we capped #page at var(--sbc-content-width) on plugin pages,
   but that also constrained the block-theme Header template part inside the
   same container, which made its horizontal nav wrap on plugin pages while
   the main site rendered a fluid-width header. Removed the #page max-width
   so the header renders at the theme's natural width; our inner content
   wrappers (.sbc-single-post, .sbc-profile, .sbc-showcase-landing) still
   center themselves at --sbc-content-width. Scoped to that theme via
   body.wp-theme-saferbuildings so it can't affect other themes if the site
   is re-themed later. */
body.wp-theme-saferbuildings #header {
    padding: 20px 0 0;
}
body.wp-theme-saferbuildings #headerimg h1 {
    margin: 0;
}
body.wp-theme-saferbuildings #headerimg .description {
    margin: 4px 0 0;
    color: var(--sbc-muted, #666);
    font-style: italic;
    font-size: 14px;
}
body.wp-theme-saferbuildings hr {
    margin: 12px 0 24px;
    border: 0;
    border-top: 1px solid var(--sbc-border, #e0e0e0);
}

/* News-item card when rendered inside the profile Blog tab */
.sbc-news-in-tab { margin: 0; }
.sbc-news-in-tab .sbc-news-item { padding: 16px 0; }
.sbc-news-in-tab .sbc-news-item:first-child { padding-top: 0; }
.sbc-news-in-tab .sbc-news-item-date {
    margin: 4px 0 8px;
    color: var(--sbc-muted, #666);
    font-size: 12px;
    font-style: italic;
}

@media (max-width: 640px) {
    .sbc-news-item {
        flex-direction: column;
        gap: 12px;
    }
    .sbc-news-item-image { flex: 0 0 auto; width: 100%; }
    .sbc-news-item-image img { height: auto; }
}

/* ---------- Filter accordion ---------- */
.sbc-filters {
    margin: 24px 0;
}
.sbc-filters-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 640px;
    background: #fff;
    border: 1.5px solid #ccc;
    border-radius: 999px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--sbc-text);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.sbc-filters-toggle:hover,
.sbc-filters-toggle:focus {
    border-color: var(--sbc-teal);
    box-shadow: 0 0 0 1px var(--sbc-teal);
    outline: none;
}
.sbc-filters-toggle-label {
    flex: 1;
    color: var(--sbc-text);
}
.sbc-filters-count {
    background: var(--sbc-teal);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.sbc-filters-chevron {
    transition: transform 0.2s;
    color: var(--sbc-muted, #666);
}
.sbc-filters-toggle.is-open .sbc-filters-chevron {
    transform: rotate(180deg);
}
.sbc-filters-panel {
    margin-top: 12px;
    background: var(--sbc-bg);
    border: 1px solid var(--sbc-border);
    border-radius: 4px;
    padding: 20px 24px;
}
.sbc-filters-panel[hidden] { display: none; }
.sbc-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px 32px;
}
.sbc-filter-group h4 {
    margin: 0 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sbc-teal);
    font-weight: 600;
    border-bottom: 1px solid var(--sbc-border);
    padding-bottom: 6px;
}
.sbc-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 14px;
    color: var(--sbc-text);
    cursor: pointer;
    line-height: 1.4;
}
.sbc-filter-option input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}
.sbc-filter-option span {
    word-break: break-word;
}
.sbc-filters-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--sbc-border);
}
.sbc-filters-apply {
    background: var(--sbc-teal);
    color: #fff;
    border: 1.5px solid var(--sbc-teal);
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.sbc-filters-apply:hover {
    background: var(--sbc-teal-dark);
    border-color: var(--sbc-teal-dark);
}
.sbc-filters-clear {
    color: var(--sbc-muted, #666);
    text-decoration: underline;
    font-size: 13px;
}
.sbc-filters-clear:hover {
    color: var(--sbc-text);
}

@media (max-width: 640px) {
    .sbc-filters-panel { padding: 16px; }
    .sbc-filters-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* MCS Primary + Secondary business types on the profile header */
.sbc-profile-biztype {
    margin: 6px 0 0;
    color: var(--sbc-text);
    line-height: 1.4;
}
.sbc-profile-biztype-primary {
    margin-top: 14px;
    font-weight: 600;
}
.sbc-profile-biztype-secondary {
    color: var(--sbc-muted, #666);
    font-style: italic;
}

/* Business types at the top of the Description tab */
.sbc-desc-biztypes {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--sbc-border);
}
.sbc-desc-biztypes .sbc-profile-biztype-primary { margin-top: 0; }

/* Stacked filter column — Certifications with System Integrator Capabilities beneath */
.sbc-filter-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Capability subgroups within a filter group (mirrors Find An Integrator) */
.sbc-filter-subgroup {
    margin: 0 0 14px;
}
.sbc-filter-subgroup:last-child { margin-bottom: 0; }
.sbc-filter-subgroup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--sbc-text);
    margin: 8px 0 4px;
    padding-bottom: 3px;
    border-bottom: 1px dotted var(--sbc-border);
}

/* ---------- Blog Portal (frontend editor) ---------- */
.sbc-blog-portal {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--sbc-text);
}
.sbc-blog-flash {
    padding: 10px 14px;
    border-radius: 3px;
    margin: 0 0 16px;
    font-size: 14px;
}
.sbc-blog-flash-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #2e7d32; }
.sbc-blog-flash-error   { background: #ffebee; color: #b71c1c; border-left: 4px solid #b32d2e; }

.sbc-blog-login { max-width: 480px; }
.sbc-blog-login h2, .sbc-blog-dashboard h2, .sbc-blog-editor h2 { margin-top: 0; }

.sbc-blog-btn {
    display: inline-block;
    background: #fff;
    color: var(--sbc-text);
    border: 1px solid #ccc;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.sbc-blog-btn:hover { border-color: var(--sbc-teal); color: var(--sbc-teal); }
.sbc-blog-btn-primary { background: var(--sbc-teal); color: #fff; border-color: var(--sbc-teal); }
.sbc-blog-btn-primary:hover { background: var(--sbc-teal-dark); color: #fff; }

.sbc-blog-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.sbc-blog-post-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.sbc-blog-post-list th,
.sbc-blog-post-list td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--sbc-border);
    font-size: 14px;
}
.sbc-blog-post-list th {
    background: #f7f7f7;
    color: var(--sbc-text);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sbc-blog-editor label { display: block; margin: 16px 0 6px; }

/* Hide the theme's hard-coded "proudly powered by WordPress" footer credit
   on pages our plugin renders (single-member_org.php, single-post.php,
   landing shortcode). showcase.css only loads on those pages, so this
   selector never affects the theme's normal pages. */
body.wp-theme-saferbuildings #footer[role="contentinfo"] {
    display: none;
}

/* Filter topbar: search input + toggle bar + Apply button on one row */
.sbc-filters-topbar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.sbc-filters-search-wrap {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 460px;
    display: flex;
    align-items: stretch;
}
.sbc-filters-search {
    width: 100%;
    background: #fff;
    border: 1.5px solid #ccc;
    border-radius: 999px;
    padding: 12px 44px 12px 24px;
    font-size: 15px;
    color: var(--sbc-text);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.sbc-filters-search::placeholder {
    color: var(--sbc-text-muted, #666);
    opacity: 1;
}
.sbc-filters-search:focus {
    border-color: var(--sbc-teal);
    box-shadow: 0 0 0 1px var(--sbc-teal);
    outline: none;
}
.sbc-filters-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    background: #e0e0e0;
    color: #444;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.sbc-filters-search-clear:hover {
    background: var(--sbc-teal);
    color: #fff;
}
.sbc-filters-search-clear[hidden] {
    display: none;
}
.sbc-filters-topbar .sbc-filters-toggle {
    flex: 1 1 320px;
    max-width: 540px;
    white-space: nowrap;
}
.sbc-filters-topbar .sbc-filters-toggle .sbc-filters-toggle-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sbc-filters-topbar .sbc-filters-apply {
    flex: 0 0 auto;
    align-self: stretch;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .sbc-filters-topbar { flex-direction: column; }
    .sbc-filters-topbar .sbc-filters-search-wrap,
    .sbc-filters-topbar .sbc-filters-toggle,
    .sbc-filters-topbar .sbc-filters-apply { width: 100%; max-width: none; flex: 1 1 auto; }
}

/* Byline on single blog post — Author | Title | Organization */
.sbc-post-byline {
    margin: 8px 0 20px;
    color: var(--sbc-text);
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

/* Hide the theme's classic Kubrick-style site title/tagline that get_header()
   outputs on plugin-rendered pages. The block theme's Header template part
   (rendered right after) provides the proper branded header. Same scoping
   pattern as the #footer credit hide. */
body.wp-theme-saferbuildings #header,
body.wp-theme-saferbuildings #headerimg {
    display: none;
}

/* Generic Label: Value rows for Header/Body/Products attributes flagged in the matrix.
   Only kicks in for attributes without a dedicated render path. */
.sbc-generic-attrs { margin-top: 12px; }
.sbc-generic-attr {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sbc-text);
}
.sbc-generic-attr-label {
    font-weight: 600;
    color: var(--sbc-text);
    margin-right: 4px;
}

/* Website link on profile — globe icon + "Website" label, matches contractor
   dashboard styling. Compact inline link, no underline, teal color. */
.sbc-profile-website-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sbc-teal);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}
.sbc-profile-website-link:hover {
    color: var(--sbc-teal-dark);
    text-decoration: underline;
}
.sbc-profile-website-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* Contact This Company CTA pill — sized to match tier badge */
.sbc-profile-cta-row {
    margin: 12px 0 0;
}
.sbc-profile-cta {
    display: inline-block;
    background: var(--sbc-teal);
    color: #fff;
    border: 1.5px solid var(--sbc-teal);
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.sbc-profile-cta:hover,
.sbc-profile-cta:focus {
    background: var(--sbc-teal-dark);
    border-color: var(--sbc-teal-dark);
    outline: none;
}

/* Blog Admin Login link — top-right of the Blog tab panel, only visible when
   Blog tab is active (since it's inside the panel). TESTING: hardwired to
   wp-login.php → post-new.php so an admin lands in the WP WYSIWYG editor.
   Production: will point to the Member Blog Portal shortcode page for
   magic-link authenticated author login. */
.sbc-blog-admin-login {
    text-align: right;
    margin: 0 0 16px;
}
.sbc-blog-admin-login a {
    color: var(--sbc-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
}
.sbc-blog-admin-login a:hover {
    color: var(--sbc-teal-dark);
}

/* ---------- Blog Portal frontend UI (Manage Blog Posts) ---------- */
.sbc-blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    align-items: flex-start;
}
.sbc-blog-main {
    min-width: 0;
}
.sbc-blog-page-title {
    color: var(--sbc-teal);
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sbc-teal);
}
.sbc-blog-context {
    color: #666;
    font-size: 13px;
    margin: 0 0 20px;
}
.sbc-blog-post-title-link {
    color: var(--sbc-teal);
    text-decoration: underline;
    font-weight: 500;
}
.sbc-blog-post-title-link:hover { color: var(--sbc-teal-dark); }
.sbc-blog-status-tag {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.sbc-blog-status-draft   { background: #fff3cd; color: #b45309; }
.sbc-blog-status-pending { background: #fff3cd; color: #b45309; }
.sbc-blog-status-private { background: #eee;    color: #666; }

/* Service Provider Menu — light theme with rounded pill items */
.sbc-blog-sidebar {
    background: #fff;
    color: var(--sbc-text);
    padding: 20px 20px 24px;
    border: 1px solid var(--sbc-border);
    border-radius: 8px;
}
.sbc-blog-sidebar h3 {
    color: var(--sbc-teal);
    padding: 0 0 10px;
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--sbc-teal);
}
.sbc-blog-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sbc-blog-side-item {
    padding: 0;
    border: none;
}
.sbc-blog-side-item a,
.sbc-blog-side-item span {
    display: block;
    padding: 10px 18px;
    color: var(--sbc-text);
    text-decoration: none;
    font-size: 14px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.sbc-blog-side-item a:hover {
    border-color: var(--sbc-teal);
    color: var(--sbc-teal);
    background: #f5fafa;
}
.sbc-blog-side-item.is-current a,
.sbc-blog-side-item.is-current span {
    background: var(--sbc-teal);
    border-color: var(--sbc-teal);
    color: #fff;
    font-weight: 600;
}
.sbc-blog-side-item.is-future span {
    color: #b8b8b8;
    cursor: not-allowed;
    font-style: italic;
}

@media (max-width: 900px) {
    .sbc-blog-layout {
        grid-template-columns: 1fr;
    }
    .sbc-blog-sidebar { order: -1; }
}

/* Sortable table headers in Blog Portal Manage Blog Posts */
.sbc-blog-sort-link {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.sbc-blog-sort-link:hover { color: var(--sbc-teal); }
.sbc-blog-sort-link span { color: var(--sbc-teal); font-size: 10px; }

/* Admin author filter dropdown above the Manage Blog Posts table */
.sbc-blog-author-filter {
    margin: 0 0 16px;
}
.sbc-blog-author-filter label {
    font-size: 13px;
    color: #666;
}
.sbc-blog-author-filter select {
    margin-left: 6px;
    padding: 6px 10px;
    font-size: 14px;
    min-width: 260px;
}

/* Tab row: tab nav on the left, Blog Admin Login on the right, one row */
.sbc-tab-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.sbc-tab-row .sbc-tab-nav {
    flex: 1 1 auto;
}
.sbc-tab-row-actions {
    flex: 0 0 auto;
    padding-right: 4ch;
}
.sbc-blog-admin-login-inline {
    color: var(--sbc-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
}
.sbc-blog-admin-login-inline:hover { color: var(--sbc-teal-dark); }

/* Single-post two-column layout: article on the left, sidebar right */
/* v0.5.67: the article column is CENTERED on the page in the exact same slot
   as a Latest News article (max 900px, page-centered); the Partner sidebar
   hangs to the right of it in the spare right-hand track. Symmetric side
   tracks keep the 900px column truly centered; the sidebar caps to its track
   on narrower screens and drops below the article under 1400px. */
.sbc-single-post-layout {
    padding: 24px 20px 48px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(24px, 1fr) minmax(0, 900px) minmax(24px, 1fr);
    align-items: flex-start;
}
/* v0.5.64: normalize left indentation baked into Word/rich-text-pasted member
   content (nested export wrappers with hard-coded padding-left/margin-left) so
   the article body shares the same left gutter as the title, byline and hero.
   The durable fix is cleaning this cruft on import; this is the safety net. */
.sbc-post-body div {
    margin-left: 0 !important;
    padding-left: 0 !important;
}
.sbc-single-post-layout .sbc-post-article {
    grid-column: 2;
    min-width: 0;
}
.sbc-post-sidebar-wrap {
    grid-column: 3;
    justify-self: start;
    margin-left: 24px;
    width: 280px;
    max-width: calc(100% - 24px);
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 24px;
}
/* "This Post Provided by..." panel — same card as Quick Links */
.sbc-provided-by-sponsored {
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--sbc-border);
}
.sbc-provided-by-sponsored .sbc-badge-sponsored {
    display: inline-block;
}
.sbc-post-provided-by .sbc-provided-by-logo {
    display: block;
    text-align: center;
    padding: 8px 0 4px;
}
.sbc-post-provided-by .sbc-provided-by-logo img {
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    display: inline-block;
    object-fit: contain;
}
@media (max-width: 1400px) {
    .sbc-single-post-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .sbc-single-post-layout .sbc-post-article {
        grid-column: 1;
        width: 100%;
        max-width: 900px;
        margin: 0 auto;
    }
    .sbc-post-sidebar-wrap {
        grid-column: 1;
        position: static;
        width: 100%;
        max-width: 900px;
        margin: 24px auto 0;
    }
}

/* Sort Profiles By dropdown — styled as pill matching the search + toggle */
.sbc-filters-sort {
    flex: 0 1 240px;
    max-width: 260px;
    display: flex;
    align-items: stretch;
}
.sbc-filters-sort-label {
    display: block;
    width: 100%;
}
.sbc-filters-sort select {
    width: 100%;
    background: #fff;
    border: 1.5px solid #ccc;
    border-radius: 999px;
    padding: 12px 40px 12px 24px;
    font-size: 15px;
    font-family: inherit;
    color: var(--sbc-text);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='%23555'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 10px 6px;
}
.sbc-filters-sort select:focus {
    border-color: var(--sbc-teal);
    box-shadow: 0 0 0 1px var(--sbc-teal);
    outline: none;
}
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
@media (max-width: 600px) {
    .sbc-filters-topbar .sbc-filters-sort {
        width: 100%; max-width: none; flex: 1 1 auto;
    }
}

/* Showcase landing page header */
.sbc-showcase-page-header {
    margin: 0 0 32px;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--sbc-border);
}
.sbc-showcase-page-title {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.2;
    color: var(--sbc-text);
    font-weight: 700;
}
.sbc-showcase-page-tagline {
    margin: 0;
    color: var(--sbc-muted, #555);
    font-size: 17px;
    line-height: 1.4;
    font-style: italic;
}
@media (max-width: 600px) {
    .sbc-showcase-page-title { font-size: 26px; }
    .sbc-showcase-page-tagline { font-size: 15px; }
}

/* Self-reported disclaimer beneath Certifications on the Products tab */
.sbc-attr-disclaimer {
    margin: -4px 0 20px;
    color: var(--sbc-muted, #666);
    font-size: 13px;
    font-style: italic;
}
