/*!
 * SBC Directory Theme — Main Stylesheet
 * v1.0.0
 */

/* ═══ CSS VARIABLES ═══ */
:root {
    --sbc-primary: #4DB7FE;
    --sbc-primary-dark: #3da5e8;
    --sbc-accent: #5ecfb1;
    --sbc-accent-dark: #4db89d;
    --sbc-title: #334e6f;
    --sbc-text: #566985;
    --sbc-muted: #7d93b2;
    --sbc-border: #e5e7f2;
    --sbc-border-light: #f0f0f0;
    --sbc-bg: #ffffff;
    --sbc-bg-soft: #f8fafc;
    --sbc-bg-alt: #f5f6fa;
    --sbc-warn: #f59e0b;
    --sbc-error: #e8734a;
    --sbc-purple: #8b5cf6;
    --sbc-radius: 12px;
    --sbc-radius-sm: 8px;
    --sbc-radius-lg: 16px;
    --sbc-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    --sbc-shadow-lg: 0 10px 40px rgba(0, 0, 0, .1);
    --sbc-header-height: 72px;
    --sbc-container: 1280px;
    --sbc-transition: all .2s ease;
    --sbc-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.sbc-body {
    margin: 0;
    padding: 0;
    font-family: var(--sbc-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--sbc-text);
    background: var(--sbc-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--sbc-title);
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 .6em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

a {
    color: var(--sbc-primary);
    text-decoration: none;
    transition: color .15s;
}
a:hover { color: var(--sbc-primary-dark); }

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

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
}

.sbc-skip-link:focus {
    position: fixed;
    top: 10px; left: 10px;
    z-index: 99999;
    padding: 10px 16px;
    background: var(--sbc-primary);
    color: #fff;
    border-radius: var(--sbc-radius-sm);
    clip: auto;
    width: auto; height: auto;
}

/* ═══ LAYOUT ═══ */
.sbc-container {
    max-width: var(--sbc-container);
    margin: 0 auto;
    padding: 0 20px;
}

.sbc-page { padding: 30px 0 60px; min-height: 60vh; }

.sbc-content-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.sbc-content-wrap .sbc-content { min-width: 0; }

/* ═══ HEADER ═══ */
.sbc-site-header {
    position: relative;
    background: #fff;
    border-bottom: 1px solid var(--sbc-border);
    z-index: 100;
}

.sbc-site-header.sbc-header-transparent {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: transparent;
    border-bottom: 0;
}

.sbc-header-inner {
    max-width: var(--sbc-container);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: var(--sbc-header-height);
}

.sbc-site-header.sbc-header-centered .sbc-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
}

.sbc-site-header.sbc-header-centered .sbc-primary-nav {
    grid-column: 2;
    justify-self: center;
}

.sbc-header-logo img,
.sbc-header-logo .custom-logo {
    max-height: 50px;
    width: auto;
}

.sbc-site-title-link {
    text-decoration: none;
    color: var(--sbc-title);
}

.sbc-site-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--sbc-title);
}

.sbc-primary-nav .sbc-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    align-items: center;
}

.sbc-primary-nav .sbc-menu a {
    display: block;
    padding: 9px 14px;
    color: var(--sbc-text);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--sbc-radius-sm);
    transition: var(--sbc-transition);
}

.sbc-primary-nav .sbc-menu a:hover,
.sbc-primary-nav .sbc-menu .current-menu-item > a,
.sbc-primary-nav .sbc-menu .current-menu-parent > a {
    background: var(--sbc-bg-alt);
    color: var(--sbc-primary);
}

.sbc-primary-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius-sm);
    box-shadow: var(--sbc-shadow);
    min-width: 200px;
    padding: 6px;
    list-style: none;
    margin: 4px 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: var(--sbc-transition);
}

.sbc-primary-nav .sbc-menu li { position: relative; }
.sbc-primary-nav .sbc-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sbc-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sbc-header-search { flex-shrink: 0; }

.sbc-header-user,
.sbc-header-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--sbc-bg-alt);
    border-radius: 20px;
    color: var(--sbc-title);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: var(--sbc-transition);
}

.sbc-header-user:hover,
.sbc-header-login:hover {
    background: var(--sbc-primary);
    color: #fff;
}

.sbc-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sbc-primary), var(--sbc-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.sbc-mobile-toggle {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 40px; height: 40px;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.sbc-mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--sbc-title);
    border-radius: 2px;
    transition: var(--sbc-transition);
}

.sbc-mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sbc-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.sbc-mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sbc-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--sbc-border);
    box-shadow: var(--sbc-shadow-lg);
    padding: 20px;
    max-height: calc(100vh - var(--sbc-header-height));
    overflow-y: auto;
}

.sbc-mobile-menu:not([hidden]) { display: block; }

.sbc-mobile-menu-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.sbc-mobile-menu-list a {
    display: block;
    padding: 12px 0;
    color: var(--sbc-title);
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--sbc-border-light);
}

/* ═══ MAIN ═══ */
.sbc-main { min-height: calc(100vh - var(--sbc-header-height) - 300px); }

/* ═══ PAGE / ARTICLE ═══ */
.sbc-page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--sbc-border);
}

.sbc-page-title { margin: 0; font-size: 2rem; }

.sbc-page-article,
.sbc-post-article { max-width: 820px; margin: 0 auto; }

/* Full-width variant — for pages containing [sbc_discover], [sbc_map], Elementor, etc. */
.sbc-article-full { max-width: 100% !important; }
.sbc-page-wide { max-width: 1400px !important; padding: 0 16px; }
.sbc-page-wide .sbc-page-content { max-width: 100%; }
.sbc-page-wide .sbc-page-article { max-width: 100%; }

.sbc-post-header { margin-bottom: 30px; }

.sbc-post-thumb {
    margin: 0 0 24px;
    border-radius: var(--sbc-radius-lg);
    overflow: hidden;
}

.sbc-post-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--sbc-muted);
    margin-bottom: 10px;
}

.sbc-meta-item i { margin-right: 4px; }
.sbc-post-meta a { color: var(--sbc-muted); }
.sbc-post-meta a:hover { color: var(--sbc-primary); }

.sbc-post-title { font-size: 2.25rem; margin: 0 0 10px; }

.sbc-post-content { font-size: 16px; line-height: 1.8; }
.sbc-post-content h2 { margin-top: 1.5em; }
.sbc-post-content img { border-radius: var(--sbc-radius); margin: 1em 0; }
.sbc-post-content blockquote {
    border-left: 4px solid var(--sbc-primary);
    padding: 4px 0 4px 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--sbc-title);
}

.sbc-post-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--sbc-border);
}

.sbc-post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sbc-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--sbc-bg-alt);
    color: var(--sbc-text);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.sbc-tag:hover {
    background: var(--sbc-primary);
    color: #fff;
}

/* ═══ POST CARDS GRID ═══ */
.sbc-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.sbc-post-card {
    background: #fff;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius);
    overflow: hidden;
    transition: var(--sbc-transition);
    display: flex;
    flex-direction: column;
}

.sbc-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sbc-shadow);
    border-color: var(--sbc-primary);
}

.sbc-post-card-thumb {
    display: block;
    aspect-ratio: 16/10;
    background: var(--sbc-bg-alt);
    overflow: hidden;
}

.sbc-post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.sbc-post-card:hover .sbc-post-card-thumb img { transform: scale(1.05); }

.sbc-post-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sbc-post-card-cat {
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.sbc-post-card-cat a {
    color: var(--sbc-primary);
    text-decoration: none;
}

.sbc-post-card-title {
    font-size: 18px;
    margin: 0 0 8px;
    line-height: 1.35;
}

.sbc-post-card-title a {
    color: var(--sbc-title);
    text-decoration: none;
}

.sbc-post-card-title a:hover { color: var(--sbc-primary); }

.sbc-post-card-meta {
    font-size: 12px;
    color: var(--sbc-muted);
    margin-bottom: 10px;
}

.sbc-post-card-excerpt {
    color: var(--sbc-text);
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 14px;
}

.sbc-post-card-more {
    color: var(--sbc-primary);
    font-weight: 700;
    font-size: 13px;
    align-self: flex-start;
}

.sbc-post-card-more i { transition: transform .2s; }
.sbc-post-card-more:hover i { transform: translateX(3px); }

/* ═══ SIDEBAR ═══ */
.sbc-sidebar {
    min-width: 0;
}

.sbc-widget {
    background: #fff;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.sbc-widget-title {
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--sbc-title);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--sbc-primary);
    display: inline-block;
}

.sbc-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sbc-widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--sbc-border-light);
    font-size: 13px;
}

.sbc-widget li:last-child { border-bottom: 0; }

/* ═══ FOOTER ═══ */
.sbc-site-footer {
    background: var(--sbc-title);
    color: rgba(255, 255, 255, .8);
    margin-top: 60px;
}

.sbc-footer-inner {
    max-width: var(--sbc-container);
    margin: 0 auto;
    padding: 0 20px;
}

.sbc-footer-top {
    padding: 50px 0 40px;
}

.sbc-footer-top .sbc-footer-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

.sbc-footer-brand .sbc-site-title { color: #fff; }

.sbc-footer-brand img,
.sbc-footer-brand .custom-logo {
    filter: brightness(0) invert(1);
    max-height: 40px;
}

.sbc-footer-tagline {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
    line-height: 1.5;
}

.sbc-footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 30px;
}

.sbc-footer-col h4,
.sbc-footer-widget-title {
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 14px;
}

.sbc-footer-col ul,
.sbc-footer-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sbc-footer-col li,
.sbc-footer-widget li {
    padding: 5px 0;
    font-size: 13px;
}

.sbc-footer-col a,
.sbc-footer-widget a {
    color: rgba(255, 255, 255, .7);
}

.sbc-footer-col a:hover,
.sbc-footer-widget a:hover { color: var(--sbc-primary); }

.sbc-footer-bottom {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 12px;
}

.sbc-footer-bottom .sbc-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.sbc-footer-copyright {
    color: rgba(255, 255, 255, .6);
}

.sbc-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 16px;
}

.sbc-footer-menu a {
    color: rgba(255, 255, 255, .6);
    font-size: 12px;
}

.sbc-footer-menu a:hover { color: #fff; }

/* ═══ BACK TO TOP ═══ */
.sbc-back-to-top {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 44px; height: 44px;
    background: var(--sbc-primary);
    color: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: var(--sbc-shadow-lg);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--sbc-transition);
    pointer-events: none;
}

.sbc-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ═══ BUTTONS (matches plugin CSS) ═══ */
.sbc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--sbc-primary);
    color: #fff !important;
    border: 0;
    border-radius: var(--sbc-radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--sbc-transition);
}

.sbc-btn:hover {
    background: var(--sbc-primary-dark);
    transform: translateY(-1px);
}

.sbc-btn-outline {
    background: transparent;
    color: var(--sbc-text) !important;
    border: 1px solid var(--sbc-border);
}

.sbc-btn-outline:hover {
    background: var(--sbc-bg-alt);
    color: var(--sbc-primary) !important;
}

/* ═══ SEARCH FORM ═══ */
.sbc-search-form {
    display: flex;
    gap: 8px;
}

.sbc-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius-sm);
    font-family: inherit;
    font-size: 14px;
}

.sbc-search-input:focus {
    outline: none;
    border-color: var(--sbc-primary);
    box-shadow: 0 0 0 3px rgba(77, 183, 254, .15);
}

.sbc-search-submit {
    padding: 10px 16px;
    background: var(--sbc-primary);
    color: #fff;
    border: 0;
    border-radius: var(--sbc-radius-sm);
    cursor: pointer;
}

/* ═══ COMMENTS ═══ */
.sbc-comments {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--sbc-border);
}

.sbc-comments-title {
    margin-bottom: 24px;
    font-size: 20px;
}

.sbc-comment-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.sbc-comment-list li {
    padding: 16px;
    margin-bottom: 14px;
    background: var(--sbc-bg-soft);
    border-radius: var(--sbc-radius-sm);
    border: 1px solid var(--sbc-border);
}

.sbc-comment-list .children {
    list-style: none;
    margin-left: 24px;
    padding: 0;
}

.sbc-comment-form input[type="text"],
.sbc-comment-form input[type="email"],
.sbc-comment-form input[type="url"],
.sbc-comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

.sbc-comment-form input:focus,
.sbc-comment-form textarea:focus {
    outline: none;
    border-color: var(--sbc-primary);
    box-shadow: 0 0 0 3px rgba(77, 183, 254, .15);
}

/* ═══ PAGINATION ═══ */
.sbc-pagination,
.pagination,
.wp-pagenavi {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.sbc-pagination a,
.sbc-pagination span,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--sbc-border);
    border-radius: var(--sbc-radius-sm);
    color: var(--sbc-text);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

.sbc-pagination a:hover,
.pagination a:hover {
    background: var(--sbc-bg-soft);
    border-color: var(--sbc-primary);
    color: var(--sbc-primary);
}

.sbc-pagination .current,
.pagination .current {
    background: var(--sbc-primary);
    color: #fff;
    border-color: var(--sbc-primary);
}

/* ═══ GUTENBERG BLOCK SUPPORT ═══ */
.sbc-post-content .alignwide {
    max-width: 1080px;
    margin-left: calc(50% - 540px);
    margin-right: calc(50% - 540px);
}

.sbc-post-content .alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.sbc-post-content .wp-block-image img { border-radius: var(--sbc-radius); }

/* ═══ WOOCOMMERCE BASIC ═══ */
.woocommerce ul.products li.product .button {
    background: var(--sbc-primary) !important;
    color: #fff !important;
}

.woocommerce span.onsale {
    background: var(--sbc-error) !important;
    border-radius: 20px !important;
}

/* ═══ NO POSTS / EMPTY STATES ═══ */
.sbc-no-posts {
    text-align: center;
    padding: 60px 20px;
    background: var(--sbc-bg-soft);
    border-radius: var(--sbc-radius-lg);
}

.sbc-no-posts h2 { margin: 0 0 10px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .sbc-content-wrap { grid-template-columns: 1fr; }
    .sbc-sidebar { margin-top: 30px; }
    .sbc-footer-top .sbc-footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }

    .sbc-header-inner { padding: 0 14px; }
    .sbc-site-header.sbc-header-centered .sbc-header-inner { grid-template-columns: auto auto; }
    .sbc-site-header.sbc-header-centered .sbc-primary-nav { display: none; }

    .sbc-primary-nav,
    .sbc-header-search,
    .sbc-header-user-name { display: none; }

    .sbc-mobile-toggle { display: flex; }

    .sbc-page { padding: 20px 0 40px; }
    .sbc-post-title { font-size: 1.75rem; }

    .sbc-footer-bottom .sbc-footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 520px) {
    .sbc-posts-grid { grid-template-columns: 1fr; }
    .sbc-container { padding: 0 14px; }
}

/* ═══ ANIMATIONS ═══ */
@keyframes sbcFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sbc-fade-in { animation: sbcFadeIn .3s ease-out; }
