/**
 * Blog & Search Templates CSS
 * 
 * Styling for single post, archive, search results, and post cards
 */

/* ===================================
   Container & Layout
   =================================== */

.container {
    max-width: var(--dmn-site-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   Post Card (Reusable Component)
   =================================== */

.dmn-post-card {
    background: var(--dmn-neutral, #fff);
    border-radius: var(--dmn-image-radius, 12px);
    overflow: hidden;
    box-shadow: var(--box-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dmn-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.post-card-image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    display: block;
}

.post-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0;
    /* Override global image radius for card images */
}

.dmn-post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--dmn-primary, #0066cc);
    color: var(--dmn-button-text, #fff);
    padding: 6px 12px;
    border-radius: var(--dmn-button-radius, 6px);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-card-meta svg {
    opacity: 0.6;
}

.post-card-title {
    font-size: var(--dmn-h3-size, 20px);
    font-weight: var(--dmn-h3-weight, 700);
    font-family: var(--dmn-h3-font, var(--dmn-font-heading));
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.post-card-title a {
    color: var(--dmn-h3-color, #1a1a1a);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card-title a:hover {
    color: var(--dmn-primary, #0066cc);
}

.post-card-excerpt {
    color: var(--dmn-text, #555);
    line-height: var(--dmn-line-height, 1.6);
    margin: 0 0 16px 0;
    flex: 1;
}

.post-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dmn-link, #0066cc);
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
    transition: gap 0.2s ease;
}

.post-card-link:hover {
    gap: 12px;
    color: var(--dmn-hover, #003580);
}

/* ===================================
   Single Post
   =================================== */

.dmn-single-post {
    background: #fff;
}

/* Hero Section */
.post-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 60px;
}

.post-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.post-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
}

.post-hero-content {
    position: relative;
    z-index: 2;
    padding: 80px 0;
}

.post-category-badge {
    display: inline-block;
    background: var(--dmn-primary, #0066cc);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.post-category-badge:hover {
    transform: scale(1.05);
}

.post-title {
    font-size: var(--dmn-h1-size, 48px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 24px 0;
    max-width: var(--dmn-site-width, 1200px);
    margin-left: auto;
    margin-right: auto;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--dmn-gap-small);
    font-size: 15px;
    opacity: 0.95;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Content */
.post-content-wrapper {
    padding: 0 0 80px 0;
}

.post-content {
    max-width: 800px;
    margin: 0 auto 60px auto;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.post-content h2 {
    font-size: var(--dmn-h2-size, 32px);
    font-weight: 700;
    margin: 48px 0 24px 0;
}

.post-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 36px 0 16px 0;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
}

.post-content a {
    color: var(--dmn-primary, #0066cc);
    text-decoration: underline;
}

/* Tags */
.post-tags {
    max-width: 800px;
    margin: 0 auto 40px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid #e5e5e5;
}

.post-tags svg {
    color: #666;
}

.post-tag {
    background: #f5f5f5;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.post-tag:hover {
    background: var(--dmn-primary, #0066cc);
    color: #fff;
}

/* Author Box */
.post-author-box {
    max-width: 800px;
    margin: 0 auto 60px auto;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    gap: var(--dmn-gap-small);
    align-items: center;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.author-bio {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* Post Navigation */
.post-navigation {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--dmn-gap-small);
}

.post-nav-link {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.post-nav-link:hover {
    background: #f0f0f0;
    transform: translateX(4px);
}

.post-nav-prev:hover {
    transform: translateX(-4px);
}

.post-nav-content {
    flex: 1;
}

.post-nav-label {
    display: block;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.post-nav-title {
    display: block;
    font-weight: 600;
    font-size: 16px;
}

/* Related Posts */
.related-posts {
    background: #f9f9f9;
    padding: 80px 0;
}

.related-posts-title {
    text-align: center;
    font-size: var(--dmn-h2-size, 36px);
    font-weight: 700;
    margin: 0 0 48px 0;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

/* ===================================
   Archive
   =================================== */

.dmn-blog-archive {
    background: #fff;
}

.archive-header {
    background: var(--dmn-tertiary, #0066cc);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.archive-title {
    font-size: var(--dmn-h1-size, 48px);
    font-weight: 800;
    margin: 0 0 16px 0;
}

.archive-description {
    font-size: 18px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

.archive-filters {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filter-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 16px 0;
}

.filter-tab {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-tab:hover {
    background: #f5f5f5;
}

.filter-tab.active {
    background: var(--dmn-primary, #0066cc);
    color: #fff;
}

.filter-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
}

.filter-tab.active .filter-count {
    background: rgba(255, 255, 255, 0.2);
}

.archive-content {
    padding: 60px 0;
}

.posts-grid {
    display: grid;
    gap: var(--dmn-gap-medium);
    margin-bottom: 60px;
}

.posts-grid.columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.posts-grid.columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.posts-grid.columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Pagination */
.archive-pagination,
.search-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.archive-pagination a,
.archive-pagination span,
.search-pagination a,
.search-pagination span {
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-weight: 600;
    background: #f5f5f5;
    transition: background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.archive-pagination a:hover,
.search-pagination a:hover {
    background: var(--dmn-primary, #0066cc);
    color: #fff;
}

.archive-pagination .current,
.search-pagination .current {
    background: var(--dmn-primary, #0066cc);
    color: #fff;
}

/* Empty State */
.archive-empty {
    text-align: center;
    padding: 80px 20px;
}

.archive-empty svg {
    color: #ccc;
    margin-bottom: 24px;
}

.archive-empty h2 {
    font-size: var(--dmn-h2-size, 32px);
    font-weight: 700;
    margin: 0 0 12px 0;
}

.archive-empty p {
    color: #666;
    font-size: 18px;
    margin: 0 0 32px 0;
}

.archive-empty .button {
    display: inline-block;
    background: var(--dmn-primary, #0066cc);
    color: #fff;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.archive-empty .button:hover {
    transform: scale(1.05);
}

/* ===================================
   Search Results
   =================================== */

.dmn-search-results {
    background: #fff;
}

.search-header {
    background: var(--dmn-tertiary, #0066cc);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.search-title {
    font-size: var(--dmn-h2-size, 36px);
    font-weight: 700;
    margin: 0 0 12px 0;
}

.search-query {
    color: #fff;
    opacity: 0.95;
}

.search-count {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
}

.search-filters {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--dmn-box-shadow);
}

.search-content {
    padding: 60px 0;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: var(--dmn-gap-small);
    margin-bottom: 60px;
}

.search-result-item {
    background: #fff;
    box-shadow: var(--dmn-box-shadow);
    border-radius: var(--dmn-image-radius);
    padding: 24px;
    display: flex;
    gap: var(--dmn-gap-small);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.search-result-item:hover {
    transform: translateY(-2px);
}

.search-result-image {
    width: 200px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
}

.search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.search-result-type {
    background: var(--dmn-primary, #0066cc);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.search-result-date,
.search-result-price {
    color: #666;
}

.search-result-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.search-result-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-result-title a:hover {
    color: var(--dmn-primary, #0066cc);
}

.search-result-excerpt {
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.search-result-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--dmn-primary, #0066cc);
    font-weight: 600;
    text-decoration: none;
    transition: gap 0.2s ease;
}

.search-result-link:hover {
    gap: 12px;
}

/* Search Empty State */
.search-empty {
    text-align: center;
    padding: 80px 20px;
}

.search-empty svg {
    color: #ccc;
    margin-bottom: 24px;
}

.search-empty h2 {
    font-size: var(--dmn-h2-size, 32px);
    font-weight: 700;
    margin: 0 0 12px 0;
}

.search-empty p {
    color: #666;
    font-size: 18px;
    margin: 0 0 32px 0;
}

.search-suggestions {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    margin: 0 auto 32px auto;
    text-align: left;
}

.search-suggestions h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.search-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-suggestions li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 24px;
}

.search-suggestions li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--dmn-primary, #0066cc);
    font-weight: 700;
}

/* ===================================
   Shortcode Layouts
   =================================== */

.dmn-posts-shortcode {
    margin: 60px 0;
}

.dmn-posts-shortcode .dmn-posts-grid {
    display: grid;
    gap: var(--dmn-gap-medium);
}

.dmn-posts-shortcode.columns-2 .dmn-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.dmn-posts-shortcode.columns-3 .dmn-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.dmn-posts-shortcode.columns-4 .dmn-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Slider Layout */
.dmn-posts-slider {
    position: relative !important;
    padding: 0 0 80px 0 !important;
    /* Bottom padding for navigation */
}

.dmn-posts-slider .swiper-button-prev,
.dmn-posts-slider .swiper-button-next {
    width: 48px;
    height: 48px;
    background: var(--dmn-neutral, #fff);
    border-radius: 50%;
    box-shadow: var(--box-shadow, 0 4px 12px rgba(0, 0, 0, 0.1));
    color: var(--dmn-primary, #0066cc);
    position: absolute;
    top: auto;
    bottom: 0;
    margin: 0;
}

.dmn-posts-slider .swiper-button-prev {
    left: auto;
    right: 64px;
    margin: 10px !important;
    /* Next to the next button */
}

.dmn-posts-slider .swiper-button-next {
    right: 0;
    margin: 10px !important;
}

.dmn-posts-slider .swiper-button-prev:after,
.dmn-posts-slider .swiper-button-next:after {
    font-size: 20px;
    font-weight: 700;
}

.dmn-posts-slider .swiper-button-prev:hover,
.dmn-posts-slider .swiper-button-next:hover {
    transform: translateY(-2px);
}

.dmn-posts-slider .swiper-pagination {
    display: none;
    /* Hide pagination dots */
}

.dmn-posts-slider .swiper-pagination-bullet {
    background: var(--dmn-primary, #0066cc);
    opacity: 0.3;
}

.dmn-posts-slider .swiper-pagination-bullet-active {
    opacity: 1;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
    .post-title {
        font-size: var(--dmn-h2-size, 32px);
    }

    .post-meta {
        font-size: 14px;
        gap: 16px;
    }

    .post-content {
        font-size: 16px;
    }

    .post-author-box {
        flex-direction: column;
        text-align: center;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .archive-title {
        font-size: var(--dmn-h2-size, 32px);
    }

    .posts-grid.columns-2,
    .posts-grid.columns-3,
    .posts-grid.columns-4 {
        grid-template-columns: 1fr;
    }

    .search-result-item {
        flex-direction: column;
    }

    .search-result-image {
        width: 100%;
        height: 200px;
    }

    .dmn-posts-slider {
        padding: 0 20px;
    }
}