/* SEO Archive Builder - Global Theme Compatible Styles */

/* Reset and Base Styles */
.sab-archive-page * {
    box-sizing: border-box;
}

.sab-archive-page img {
    max-width: 100%;
    height: auto;
}

/* Archive Header Styles */
.sab-archive-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.sab-archive-title {
    font-size: 2.2em;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
    line-height: 1.2;
}

.sab-archive-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2271b1;
}

.sab-archive-intro p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
}

/* Listing Actions */
.sab-listing-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.sab-listing-count,
.rtin-title {
    margin: 0;
    font-size: 1.4em;
    color: #333;
    font-weight: 500;
}

/* Sorting Controls */
.sab-sorting,
.listing-sorting {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sab-fallback-sorting select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

/* Listings Container */
.sab-listings-container {
    margin-bottom: 30px;
}

/* Fallback Listing Cards */
.sab-listings-wrapper {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.sab-listings-wrapper.sab-view-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.sab-listings-wrapper.sab-view-list {
    grid-template-columns: 1fr;
}

.sab-listing-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
}

.sab-listing-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sab-listing-card.sab-grid-view {
    flex-direction: column;
}

.sab-listing-card.sab-list-view {
    flex-direction: row;
    align-items: flex-start;
}

.sab-listing-thumbnail {
    flex-shrink: 0;
}

.sab-listing-card.sab-grid-view .sab-listing-thumbnail {
    width: 100%;
    height: 200px;
}

.sab-listing-card.sab-list-view .sab-listing-thumbnail {
    width: 150px;
    height: 120px;
    margin-right: 15px;
}

.sab-listing-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sab-listing-content {
    padding: 15px;
    flex: 1;
}

.sab-listing-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.sab-listing-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sab-listing-title a:hover {
    color: #2271b1;
}

.sab-listing-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.sab-listing-meta {
    font-size: 0.9em;
    color: #999;
}

/* No Results */
.sab-no-results {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sab-no-results h3 {
    color: #333;
    margin-bottom: 10px;
}

.sab-no-results p {
    color: #666;
    margin: 0;
}

/* Fallback Sidebar */
.sab-fallback-sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sab-sidebar-widget {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.sab-sidebar-widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sab-sidebar-widget h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
}

.sab-sidebar-widget form {
    display: flex;
    gap: 5px;
}

.sab-sidebar-widget input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.sab-sidebar-widget button {
    padding: 8px 15px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.sab-sidebar-widget button:hover {
    background: #1d5f96;
}

.sab-sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sab-sidebar-widget li {
    margin-bottom: 8px;
}

.sab-sidebar-widget a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

.sab-sidebar-widget a:hover {
    color: #2271b1;
}

/* Pagination */
.sab-pagination {
    margin: 30px 0;
    text-align: center;
}

.sab-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    color: #555;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sab-pagination .page-numbers:hover,
.sab-pagination .page-numbers.current {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* SEO Content Styles */
.sab-seo-content {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.sab-seo-description h2 {
    color: #2271b1;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.sab-seo-description h3 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

/* Taxonomy Descriptions */
.sab-taxonomy-descriptions {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.category-description,
.location-description,
.combined-description {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-description:last-child,
.location-description:last-child,
.combined-description:last-child {
    margin-bottom: 0;
}

.category-description h3,
.location-description h3,
.combined-description h3 {
    color: #2271b1;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.category-description p,
.location-description p,
.combined-description p {
    margin: 0;
    line-height: 1.6;
    color: #555;
    font-size: 1.05em;
}

/* Content Sections */
.seo-content-intro {
    margin-bottom: 30px;
}

.seo-content-intro p {
    font-size: 1.1em;
    line-height: 1.7;
    color: #555;
}

.seo-content-sections {
    margin: 30px 0;
}

.sab-content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.sab-content-col ul {
    list-style: none;
    padding: 0;
}

.sab-content-col li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 20px;
}

.sab-content-col li:before {
    content: "✓";
    color: #46b450;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.seo-content-tips {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.tips-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.tips-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.seo-content-faq {
    margin: 30px 0;
}

.faq-item {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #2271b1;
}

.faq-item h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

.seo-content-conclusion {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid #dee2e6;
}

.seo-content-conclusion h3 {
    color: #2271b1;
    margin-top: 0;
}

.seo-content-conclusion p {
    font-size: 1.1em;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sab-archive-title {
        font-size: 1.8em;
    }
    
    .sab-listing-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sab-listings-wrapper.sab-view-grid {
        grid-template-columns: 1fr;
    }
    
    .sab-listing-card.sab-list-view {
        flex-direction: column;
    }
    
    .sab-listing-card.sab-list-view .sab-listing-thumbnail {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .sab-seo-content {
        padding: 20px;
        margin-top: 20px;
    }
    
    .sab-seo-description h2 {
        font-size: 1.5em;
    }
    
    .sab-content-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sab-taxonomy-descriptions {
        padding: 15px;
    }
    
    .category-description,
    .location-description,
    .combined-description {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .sab-archive-intro {
        padding: 15px;
    }
    
    .sab-sidebar-widget form {
        flex-direction: column;
    }
    
    .sab-sidebar-widget input[type="text"] {
        margin-bottom: 5px;
    }
}

/* Theme Compatibility Classes */
.sab-archive-page .content-main {
    width: 75%;
    float: left;
}

.sab-archive-page .sidebar {
    width: 25%;
    float: right;
}

.sab-archive-page .content-row::after {
    content: "";
    display: table;
    clear: both;
}

.sab-archive-page .site-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Integration with existing theme styles */
.sab-archive-page .rtcl {
    /* Inherit existing RTCL styles when available */
}

.sab-archive-page .classima-listing-archive {
    /* Maintain compatibility with Classima */
}

/* Print Styles */
@media print {
    .sab-listing-actions,
    .sab-fallback-sidebar,
    .sab-pagination {
        display: none;
    }
    
    .sab-archive-page {
        background: white;
    }
    
    .sab-listing-card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}