/* Simple Blog Manager Frontend Styles */

:root {
    --sbm-primary: #0073aa;
    --sbm-secondary: #6c757d;
    --sbm-success: #28a745;
    --sbm-danger: #dc3545;
    --sbm-warning: #ffc107;
    --sbm-info: #17a2b8;
    --sbm-light: #f8f9fa;
    --sbm-dark: #343a40;
    --sbm-border: #dee2e6;
}

.sbm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sbm-content {
    display: block;
    min-height: 500px;
}

/* Navigation */
.sbm-navigation {
    background: var(--sbm-dark);
    color: white;
    padding: 0;
    margin-bottom: 30px;
}

.sbm-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.sbm-nav-brand {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.sbm-nav-brand img {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.sbm-nav-brand h2 {
    color: white;
    margin: 0;
    padding: 15px 0;
    font-size: 1.5em;
}

.sbm-nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.sbm-nav-menu li {
    margin: 0;
}

.sbm-nav-menu li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 20px 15px;
    display: block;
    transition: all 0.3s;
}

.sbm-nav-menu li a:hover,
.sbm-nav-menu li.active a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sbm-nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.sbm-user-name {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 15px;
}

.sbm-logout-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    background: var(--sbm-danger);
    border-radius: 4px;
    transition: opacity 0.3s;
}

.sbm-logout-link:hover {
    opacity: 0.8;
}

/* Forms */
.sbm-form-group {
    margin-bottom: 20px;
}

.sbm-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--sbm-dark);
}

.sbm-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--sbm-border);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.sbm-form-control:focus {
    outline: none;
    border-color: var(--sbm-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.sbm-large-input {
    font-size: 18px;
    padding: 12px;
}

.sbm-form-row {
    display: flex;
    gap: 20px;
}

.sbm-col-6 {
    flex: 1;
}

.sbm-form-check {
    display: flex;
    align-items: center;
}

.sbm-form-check input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.sbm-help-text {
    display: block;
    margin-top: 5px;
    color: var(--sbm-secondary);
    font-size: 13px;
}

/* Buttons */
.sbm-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.sbm-btn-primary {
    background: var(--sbm-primary);
    color: white;
}

.sbm-btn-primary:hover {
    background: #005a87;
}

.sbm-btn-secondary {
    background: var(--sbm-secondary);
    color: white;
}

.sbm-btn-secondary:hover {
    background: #5a6268;
}

.sbm-btn-danger {
    background: var(--sbm-danger);
    color: white;
}

.sbm-btn-danger:hover {
    background: #c82333;
}

.sbm-btn-link {
    background: transparent;
    color: var(--sbm-primary);
    text-decoration: underline;
}

.sbm-btn-link:hover {
    color: #005a87;
}

.sbm-btn-block {
    display: block;
    width: 100%;
}

.sbm-btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

.sbm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.sbm-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sbm-message.sbm-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sbm-message.sbm-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sbm-message.sbm-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Login Page */
.sbm-login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    padding: 40px 20px;
}

/* Hide Divi header/navigation on all blog manager pages */
body.sbm-page #main-header,
body.sbm-page #top-header,
body.sbm-page .et_pb_menu,
body.sbm-page .et_pb_fullwidth_menu,
body.sbm-page .et-top-navigation,
body.sbm-page .et_header_style_left,
body.sbm-page header.et-l,
body.sbm-login-page #main-header,
body.sbm-login-page #top-header,
body.sbm-login-page .et_pb_menu,
body.sbm-login-page .et_pb_fullwidth_menu,
body.sbm-login-page #et-main-area > .et_pb_section:first-child,
body.sbm-login-page #page-container > #et-main-area > div:first-child > .et_pb_section:first-child {
    display: none !important;
}

/* Hide the large Sealco logo and any Divi sections that appear above content */
body.sbm-page .entry-content > h1:first-child,
body.sbm-page .entry-content > .et_pb_image:first-child,
body.sbm-page .et_pb_section:first-child,
body.sbm-page #et-main-area > div:first-child > h1,
body.sbm-page .et_pb_image_container,
body.sbm-page .et_pb_row:has(.et_pb_image) {
    display: none !important;
}

/* Ensure our blog manager content is visible */
body.sbm-page .sbm-container {
    display: block !important;
}

.sbm-login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.sbm-login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.sbm-login-logo img {
    max-width: 200px;
    height: auto;
}

.sbm-login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--sbm-dark);
}

.sbm-login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--sbm-secondary);
}

.sbm-login-footer a {
    color: var(--sbm-primary);
    text-decoration: none;
}

/* Dashboard */
.sbm-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sbm-dashboard-header h1 {
    margin: 0;
    color: var(--sbm-dark);
}

.sbm-dashboard-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.sbm-filter-group {
    flex: 1;
    max-width: 300px;
}

.sbm-posts-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sbm-posts-table table {
    width: 100%;
    border-collapse: collapse;
}

.sbm-posts-table th {
    background: var(--sbm-light);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--sbm-dark);
    border-bottom: 2px solid var(--sbm-border);
}

.sbm-posts-table td {
    padding: 12px;
    border-bottom: 1px solid var(--sbm-border);
}

.sbm-posts-table tr:last-child td {
    border-bottom: none;
}

.sbm-posts-table tr:hover {
    background: var(--sbm-light);
}

.sbm-post-thumbnail {
    max-width: 60px;
    height: auto;
    margin-top: 5px;
    border-radius: 4px;
}

.sbm-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.sbm-status-publish {
    background: var(--sbm-success);
    color: white;
}

.sbm-status-draft {
    background: var(--sbm-warning);
    color: var(--sbm-dark);
}

.sbm-status-pending {
    background: var(--sbm-info);
    color: white;
}

.sbm-actions {
    white-space: nowrap;
}

/* Action Buttons with Icons */
.sbm-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sbm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.sbm-action-btn:hover {
    background: var(--sbm-primary);
    color: white;
    border-color: var(--sbm-primary);
}

.sbm-action-btn.sbm-action-danger:hover {
    background: var(--sbm-danger);
    border-color: var(--sbm-danger);
}

.sbm-action-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.sbm-action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
    padding: 5px 10px;
    background: #333;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none;
}

.sbm-action-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
    pointer-events: none;
}

.sbm-no-posts,
.sbm-loading,
.sbm-error {
    padding: 40px;
    text-align: center;
    color: var(--sbm-secondary);
}

/* Pagination */
.sbm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
}

.sbm-page-btn {
    padding: 8px 12px;
    border: 1px solid var(--sbm-border);
    background: white;
    color: var(--sbm-dark);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.sbm-page-btn:hover {
    background: var(--sbm-primary);
    color: white;
    border-color: var(--sbm-primary);
}

.sbm-page-current {
    padding: 8px 12px;
    background: var(--sbm-primary);
    color: white;
    border-radius: 4px;
}

.sbm-page-dots {
    padding: 8px;
    color: var(--sbm-secondary);
}

/* Post Editor */
.sbm-post-editor {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sbm-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--sbm-border);
}

.sbm-editor-header h1 {
    margin: 0;
    color: var(--sbm-dark);
}

.sbm-editor-actions {
    display: flex;
    gap: 10px;
}

.sbm-featured-image-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sbm-image-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--sbm-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--sbm-light);
}

.sbm-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.sbm-gallery-container {
    margin-top: 10px;
}

.sbm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.sbm-gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
}

.sbm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sbm-remove-gallery-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--sbm-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: opacity 0.3s;
}

.sbm-remove-gallery-image:hover {
    opacity: 0.8;
}

/* Image Library */
.sbm-image-library {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sbm-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sbm-library-header h1 {
    margin: 0;
    color: var(--sbm-dark);
}

.sbm-library-info {
    background: var(--sbm-light);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.sbm-library-info ul {
    margin: 10px 0 0 20px;
}

.sbm-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.sbm-image-card {
    background: white;
    border: 1px solid var(--sbm-border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.sbm-image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.sbm-image-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--sbm-light);
}

.sbm-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sbm-image-meta {
    padding: 10px;
    border-top: 1px solid var(--sbm-border);
}

.sbm-image-filename {
    display: block;
    font-weight: 500;
    color: var(--sbm-dark);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sbm-image-dims {
    display: block;
    font-size: 12px;
    color: var(--sbm-secondary);
}

.sbm-no-images {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--sbm-secondary);
    background: var(--sbm-light);
    border-radius: 4px;
}

/* Modal */
.sbm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sbm-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.sbm-modal-large {
    max-width: 1000px;
}

.sbm-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--sbm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sbm-modal-header h2 {
    margin: 0;
    color: var(--sbm-dark);
}

.sbm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--sbm-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sbm-modal-close:hover {
    color: var(--sbm-dark);
}

.sbm-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.sbm-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--sbm-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.sbm-image-upload-area {
    padding: 20px;
    background: var(--sbm-light);
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.sbm-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.sbm-image-item {
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
}

.sbm-image-item:hover {
    border-color: var(--sbm-primary);
}

.sbm-image-item.selected {
    border-color: var(--sbm-primary);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.sbm-image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.sbm-image-info {
    padding: 8px;
    background: var(--sbm-light);
    font-size: 12px;
}

.sbm-image-info span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sbm-image-viewer-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.sbm-image-preview-large {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sbm-light);
    border-radius: 4px;
    padding: 20px;
}

.sbm-image-preview-large img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.sbm-image-details h3 {
    margin-top: 0;
    color: var(--sbm-dark);
}

.sbm-image-details p {
    margin: 10px 0;
    color: var(--sbm-secondary);
}

.sbm-image-details strong {
    color: var(--sbm-dark);
}

.sbm-image-url-container {
    margin-top: 20px;
}

.sbm-image-url-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--sbm-dark);
}

.sbm-image-url-container input {
    margin-bottom: 10px;
}

/* Change Password */
.sbm-change-password {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.sbm-password-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.sbm-password-box h1 {
    margin-top: 0;
    margin-bottom: 30px;
    color: var(--sbm-dark);
    text-align: center;
}

.sbm-form-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
}

/* Settings Page */
.sbm-settings {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
    margin: 0 auto;
}

.sbm-settings-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--sbm-border);
}

.sbm-settings-header h1 {
    margin: 0 0 10px 0;
    color: var(--sbm-dark);
}

.sbm-settings-description {
    color: var(--sbm-secondary);
    margin: 0;
}

.sbm-settings-section {
    margin-bottom: 40px;
    padding: 25px;
    background: var(--sbm-light);
    border-radius: 6px;
}

.sbm-settings-section h2 {
    margin: 0 0 20px 0;
    color: var(--sbm-dark);
    font-size: 1.3em;
    border-bottom: 1px solid var(--sbm-border);
    padding-bottom: 10px;
}

.sbm-settings-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.sbm-settings-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    padding-top: 20px;
    border-top: 2px solid var(--sbm-border);
}

.sbm-shortcode-info {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--sbm-border);
}

.sbm-shortcode-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: var(--sbm-light);
    border-radius: 4px;
}

.sbm-shortcode-display code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--sbm-border);
    border-radius: 3px;
}

.sbm-shortcode-params {
    margin-top: 20px;
    padding: 15px;
    background: var(--sbm-light);
    border-radius: 4px;
}

.sbm-shortcode-params summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--sbm-dark);
    padding: 5px 0;
}

.sbm-shortcode-params ul {
    margin: 15px 0 10px 20px;
}

.sbm-shortcode-params li {
    margin: 8px 0;
    color: var(--sbm-secondary);
}

.sbm-shortcode-params code {
    background: white;
    padding: 2px 6px;
    border: 1px solid var(--sbm-border);
    border-radius: 3px;
    font-size: 13px;
    color: var(--sbm-dark);
}

/* Column Support for Grid */
.sbm-columns-5 .sbm-grid-container {
    grid-template-columns: repeat(5, 1fr);
}

.sbm-columns-6 .sbm-grid-container {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive */
@media (max-width: 768px) {
    .sbm-nav-container {
        flex-direction: column;
        padding: 0;
    }
    
    .sbm-nav-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .sbm-nav-menu li {
        width: 100%;
    }
    
    .sbm-nav-menu li a {
        padding: 15px 20px;
    }
    
    .sbm-nav-right {
        width: 100%;
        padding: 15px 20px;
        justify-content: space-between;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sbm-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sbm-dashboard-filters {
        flex-direction: column;
        width: 100%;
    }
    
    .sbm-filter-group {
        max-width: none;
    }
    
    .sbm-posts-table {
        overflow-x: auto;
    }
    
    .sbm-editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sbm-form-row {
        flex-direction: column;
    }
    
    .sbm-image-viewer-content {
        grid-template-columns: 1fr;
    }
    
    .sbm-modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Single Post Featured Image and Gallery */
.sbm-single-featured-image {
    margin-bottom: 30px;
}

.sbm-single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Gallery Base Styles */
.sbm-single-gallery {
    margin: 40px 0;
    position: relative;
}

.sbm-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.sbm-gallery-link {
    display: block;
    position: relative;
    cursor: zoom-in;
}

.sbm-gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.sbm-gallery-item:hover img {
    transform: scale(1.08);
    filter: brightness(0.9);
}

/* Masonry Layout */
.sbm-gallery-masonry {
    column-count: 3;
    column-gap: 15px;
}

.sbm-gallery-masonry[data-columns="2"] {
    column-count: 2;
}

.sbm-gallery-masonry[data-columns="4"] {
    column-count: 4;
}

.sbm-gallery-masonry[data-columns="5"] {
    column-count: 5;
}

.sbm-gallery-masonry .sbm-gallery-item {
    margin-bottom: 15px;
    break-inside: avoid;
}

.sbm-gallery-masonry .sbm-gallery-item img {
    height: auto;
}

/* Grid Layout (Equal Heights) */
.sbm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.sbm-gallery-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.sbm-gallery-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.sbm-gallery-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.sbm-gallery-grid .sbm-gallery-item {
    aspect-ratio: 4/3;
}

.sbm-gallery-grid .sbm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Justified Layout */
.sbm-gallery-justified {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.sbm-gallery-justified .sbm-gallery-item {
    flex-grow: 1;
    height: 250px;
    margin: 0;
    position: relative;
    overflow: hidden;
}

.sbm-gallery-justified .sbm-gallery-item:last-child {
    flex-grow: 10;
}

.sbm-gallery-justified .sbm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Carousel Layout */
.sbm-gallery-carousel {
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.sbm-gallery-carousel .sbm-gallery-item {
    display: none;
    aspect-ratio: 16/9;
}

.sbm-gallery-carousel .sbm-gallery-item:first-child {
    display: block;
}

.sbm-gallery-carousel .sbm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Gallery Responsive */
@media (max-width: 768px) {
    .sbm-gallery-masonry,
    .sbm-gallery-masonry[data-columns="4"],
    .sbm-gallery-masonry[data-columns="5"] {
        column-count: 2;
    }

    .sbm-gallery-grid,
    .sbm-gallery-grid[data-columns="4"],
    .sbm-gallery-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sbm-gallery-masonry,
    .sbm-gallery-masonry[data-columns="2"],
    .sbm-gallery-masonry[data-columns="4"],
    .sbm-gallery-masonry[data-columns="5"] {
        column-count: 1;
    }

    .sbm-gallery-grid,
    .sbm-gallery-grid[data-columns="2"],
    .sbm-gallery-grid[data-columns="4"],
    .sbm-gallery-grid[data-columns="5"] {
        grid-template-columns: 1fr;
    }
}

/* Post Navigation */
.sbm-post-navigation {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.sbm-nav-center {
    text-align: center;
    margin-bottom: 30px;
}

.sbm-back-to-blog {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 500;
}

.sbm-back-to-blog:hover {
    background: #e0e0e0;
}

.sbm-nav-links {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.sbm-nav-prev,
.sbm-nav-next {
    flex: 1;
    max-width: 45%;
}

.sbm-nav-next {
    text-align: right;
}

.sbm-nav-label {
    display: block;
    font-size: 0.875em;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sbm-nav-title {
    display: block;
    font-size: 1.1em;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.sbm-nav-title:hover {
    color: #0073aa;
}

.sbm-nav-empty {
    visibility: hidden;
}

@media (max-width: 768px) {
    .sbm-nav-links {
        flex-direction: column;
        gap: 20px;
    }

    .sbm-nav-prev,
    .sbm-nav-next {
        max-width: 100%;
        text-align: left;
    }
}