/**
 * Blog System Styles
 * Namespaced with .hsd-blog
 */

/* CSS Variables */
.hsd-blog {
    --hsd-max-width: 1200px;
    --hsd-content-width: 800px;
    --hsd-gap: 30px;
    --hsd-gap-mobile: 20px;
    --hsd-primary: #10B981;
    --hsd-primary-hover: #059669;
    --hsd-primary-light: #D1FAE5;
    --hsd-primary-dark: #065F46;
    --hsd-text-dark: #1a1a1a;
    --hsd-text-gray: #666666;
    --hsd-bg-light: #f8f9fa;
    --hsd-bg-page: #f5f5f5;
    --hsd-border: #e0e0e0;
    --hsd-radius: 8px;
    --hsd-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --hsd-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Page Background */
body.single-post {
    background-color: var(--hsd-bg-page) !important;
}

/* Container */
.hsd-blog .hsd-container {
    max-width: var(--hsd-max-width);
    margin: 0 auto;
    padding: 0 30px;
}

/* Blog Index Styles */
.hsd-blog-hero {
    background: linear-gradient(135deg, var(--hsd-primary-light) 0%, #E6FFFA 100%);
    padding: 80px 0 60px;
    text-align: center;
}

.hsd-blog-title {
    font-size: clamp(32px, 5vw, 48px);
    color: var(--hsd-text-dark);
    margin: 0 0 12px;
    font-weight: 700;
}

.hsd-blog-subtitle {
    font-size: 18px;
    color: var(--hsd-text-gray);
    margin: 0 0 32px;
}

/* Blog Search */
.hsd-blog-search {
    max-width: 500px;
    margin: 0 auto 32px;
}

.hsd-blog-search form {
    display: flex;
    background: white;
    border-radius: var(--hsd-radius);
    box-shadow: var(--hsd-shadow);
    overflow: hidden;
}

.hsd-blog-search input[type="search"] {
    flex: 1;
    padding: 14px 20px;
    border: none;
    font-size: 16px;
    outline: none;
}

.hsd-blog-search button {
    background: var(--hsd-primary);
    color: white;
    border: none;
    padding: 0 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.hsd-blog-search button:hover {
    background: var(--hsd-primary-hover);
}

/* Category Pills */
.hsd-blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.hsd-cat-pill {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    color: var(--hsd-text-gray);
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--hsd-border);
}

.hsd-cat-pill:hover {
    color: var(--hsd-primary);
    border-color: var(--hsd-primary);
}

.hsd-cat-pill.active {
    background: var(--hsd-primary);
    color: white;
    border-color: var(--hsd-primary);
}

/* Posts Grid */
.hsd-blog-posts {
    padding: 60px 0;
}

.hsd-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--hsd-gap);
    margin-bottom: 60px;
}

@media (min-width: 1024px) {
    .hsd-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Post Card */
.hsd-post-card {
    background: white;
    border-radius: var(--hsd-radius);
    overflow: hidden;
    box-shadow: var(--hsd-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--hsd-border);
}

.hsd-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hsd-shadow-lg);
}

.hsd-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--hsd-bg-light);
}

.hsd-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.hsd-card-gradient {
    background: linear-gradient(135deg, var(--hsd-primary) 0%, var(--hsd-primary-hover) 100%);
}

.hsd-card-content {
    padding: 20px;
}

.hsd-card-meta {
    margin-bottom: 12px;
}

.hsd-cat-chip {
    display: inline-block;
    padding: 4px 10px;
    background: var(--hsd-primary-light);
    color: var(--hsd-primary-dark);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.hsd-card-title {
    font-size: 20px;
    margin: 0 0 12px;
    line-height: 1.3;
}

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

.hsd-card-excerpt {
    color: var(--hsd-text-gray);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hsd-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--hsd-text-gray);
}

.hsd-reading-time {
    font-weight: 500;
}

/* Pagination */
.hsd-pagination {
    text-align: center;
}

.hsd-pagination ul {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hsd-pagination li {
    display: inline-block;
}

.hsd-pagination a,
.hsd-pagination .current {
    display: inline-block;
    padding: 10px 16px;
    background: white;
    color: var(--hsd-text-gray);
    border: 1px solid var(--hsd-border);
    border-radius: var(--hsd-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.hsd-pagination a:hover {
    background: var(--hsd-primary);
    color: white;
    border-color: var(--hsd-primary);
}

.hsd-pagination .current {
    background: var(--hsd-primary);
    color: white;
    border-color: var(--hsd-primary);
}

/* Single Post Styles */
.hsd-post-hero {
    position: relative;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    color: white;
}

.hsd-post-hero.has-image {
    background-color: #111;
}

.hsd-post-hero.no-image {
    background: linear-gradient(135deg, var(--hsd-primary-light) 0%, #E6FFFA 100%);
    color: var(--hsd-text-dark);
    min-height: 250px;
}

.hsd-hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    padding: 50px 0;
    min-height: inherit;
    display: flex;
    align-items: center;
}

.hsd-post-hero.no-image .hsd-hero-overlay {
    background: transparent;
}

/* Breadcrumbs */
.hsd-breadcrumbs {
    margin-bottom: 20px;
}

.hsd-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.hsd-breadcrumbs li::after {
    content: "›";
    margin-left: 6px;
    opacity: 0.5;
}

.hsd-breadcrumbs li:last-child::after {
    display: none;
}

.hsd-breadcrumbs a {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
}

.hsd-breadcrumbs a:hover {
    opacity: 1;
}

/* Post Meta */
.hsd-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    margin-bottom: 15px;
}

.hsd-meta-sep {
    opacity: 0.5;
}

.hsd-meta-location,
.hsd-meta-service {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.hsd-post-hero.no-image .hsd-meta-location,
.hsd-post-hero.no-image .hsd-meta-service {
    background: var(--hsd-bg-light);
}

/* Post Title & Subtitle */
.hsd-post-title {
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.2;
    margin: 0 0 16px;
    font-weight: 700;
}

.hsd-post-subtitle {
    font-size: 20px;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

/* CONTENT SECTION - WHITE BACKGROUND FIX */
.hsd-post-content {
    background-color: transparent;
    padding: 40px 0;
}

.hsd-post-content .hsd-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: var(--hsd-radius);
    box-shadow: var(--hsd-shadow);
}

/* Content Grid */
.hsd-content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--hsd-gap);
    align-items: start;
}

/* Content Main */
.hsd-content-main {
    background: transparent;
    padding: 0;
}

/* Disclosure */
.hsd-disclosure {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 16px 20px;
    border-radius: var(--hsd-radius);
    margin-bottom: 25px;
}

.hsd-disclosure p {
    margin: 0;
    font-size: 14px;
    color: #92400E;
}

/* Table of Contents */
.hsd-toc {
    background: var(--hsd-bg-light);
    padding: 20px;
    border-radius: var(--hsd-radius);
    margin-bottom: 25px;
}

.hsd-toc h2 {
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--hsd-text-dark);
}

.hsd-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hsd-toc li {
    margin: 6px 0;
}

.hsd-toc-h3 {
    padding-left: 20px;
}

.hsd-toc a {
    color: var(--hsd-text-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.hsd-toc a:hover {
    color: var(--hsd-primary);
}

/* Content Body */
.hsd-content-body {
    font-size: 17px;
    line-height: 1.7;
    color: #333333;
    background: transparent;
}

.hsd-content-body h2 {
    font-size: 1.9rem;
    margin: 35px 0 18px;
    color: var(--hsd-text-dark);
    padding-bottom: 8px;
    border-bottom: 3px solid var(--hsd-primary);
}

.hsd-content-body h3 {
    font-size: 1.4rem;
    margin: 28px 0 14px;
    color: var(--hsd-text-dark);
}

.hsd-content-body p {
    margin: 0 0 18px;
}

.hsd-content-body ul,
.hsd-content-body ol {
    margin: 0 0 18px 28px;
}

.hsd-content-body li {
    margin: 6px 0;
}

.hsd-content-body a {
    color: var(--hsd-primary);
    text-decoration: none;
}

.hsd-content-body a:hover {
    color: var(--hsd-primary-hover);
    text-decoration: underline;
}

.hsd-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--hsd-radius);
    margin: 20px 0;
}

.hsd-content-body blockquote {
    border-left: 4px solid var(--hsd-primary);
    padding-left: 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--hsd-text-gray);
}

/* Inline Ad */
.hsd-inline-ad {
    margin: 30px 0;
    padding: 20px;
    background: var(--hsd-bg-light);
    border-radius: var(--hsd-radius);
    text-align: center;
}

/* FAQs */
.hsd-post-faqs {
    margin: 40px 0 30px;
    background: var(--hsd-bg-light);
    padding: 25px;
    border-radius: var(--hsd-radius);
}

.hsd-post-faqs h2 {
    font-size: 1.7rem;
    margin: 0 0 20px;
    color: var(--hsd-text-dark);
}

.hsd-faq-item {
    background: white;
    border: 1px solid var(--hsd-border);
    border-radius: var(--hsd-radius);
    padding: 16px 20px;
    margin-bottom: 10px;
}

.hsd-faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--hsd-text-dark);
    list-style: none;
    position: relative;
    padding-right: 30px;
}

.hsd-faq-item summary::-webkit-details-marker {
    display: none;
}

.hsd-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 20px;
    color: var(--hsd-primary);
}

.hsd-faq-item[open] summary::after {
    content: "−";
}

.hsd-faq-answer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hsd-border);
    color: var(--hsd-text-gray);
}

/* Updated Note */
.hsd-updated-note {
    margin: 30px 0;
    padding: 12px 16px;
    background: var(--hsd-bg-light);
    border-radius: var(--hsd-radius);
}

.hsd-updated-note p {
    margin: 0;
    font-size: 14px;
    color: var(--hsd-text-gray);
}

/* Author Box */
.hsd-author-box {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: var(--hsd-bg-light);
    border-radius: var(--hsd-radius);
    margin: 30px 0;
}

.hsd-author-box img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.hsd-author-info h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    color: var(--hsd-text-dark);
}

.hsd-author-info p {
    margin: 0;
    color: var(--hsd-text-gray);
    font-size: 13px;
    line-height: 1.4;
}

/* Post Navigation */
.hsd-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 35px 0;
    padding-top: 25px;
    border-top: 1px solid var(--hsd-border);
}

.hsd-nav-prev,
.hsd-nav-next {
    padding: 20px;
    background: var(--hsd-bg-light);
    border-radius: var(--hsd-radius);
}

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

.hsd-nav-prev span,
.hsd-nav-next span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--hsd-text-gray);
    margin-bottom: 8px;
}

.hsd-nav-prev a,
.hsd-nav-next a {
    color: var(--hsd-primary);
    text-decoration: none;
    font-weight: 600;
}

.hsd-nav-prev a:hover,
.hsd-nav-next a:hover {
    color: var(--hsd-primary-hover);
}

/* Content Ad */
.hsd-content-ad {
    margin: 30px 0;
    padding: 20px;
    background: var(--hsd-bg-light);
    border-radius: var(--hsd-radius);
    text-align: center;
}

/* Sidebar CTA */
.hsd-content-sidebar {
    position: relative;
}

.hsd-sticky {
    position: sticky;
    top: 20px;
}

.hsd-cta-card {
    background: white;
    border: 2px solid var(--hsd-primary);
    border-radius: var(--hsd-radius);
    padding: 22px;
    box-shadow: var(--hsd-shadow);
    text-align: center;
}

.hsd-cta-card h3 {
    font-size: 1.25rem;
    margin: 0 0 12px;
    color: #4B5563; /* Grey heading */
    font-weight: 600;
}

.hsd-cta-card p {
    color: #555555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 18px;
}

.hsd-cta-form input[type="text"],
.hsd-cta-form input[type="email"],
.hsd-cta-form input[type="tel"],
.hsd-cta-form textarea,
.hsd-cta-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hsd-border);
    border-radius: var(--hsd-radius);
    font-size: 14px;
    margin-bottom: 12px;
}

.hsd-cta-form textarea {
    min-height: 100px;
}

/* Mobile CTA */
.hsd-mobile-cta {
    display: none;
    margin: 35px 0;
}

.hsd-mobile-cta .hsd-cta-card {
    background: var(--hsd-primary-light);
}

/* Button */
.hsd-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--hsd-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--hsd-radius);
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--hsd-primary);
}

.hsd-btn:hover {
    background: var(--hsd-primary-hover);
    border-color: var(--hsd-primary-hover);
    transform: translateY(-1px);
}

/* WPForms Integration */
.hsd-blog .wpforms-submit {
    background: var(--hsd-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--hsd-radius);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.hsd-blog .wpforms-submit:hover {
    background: var(--hsd-primary-hover);
}

/* No Posts */
.hsd-no-posts {
    text-align: center;
    padding: 60px 20px;
}

.hsd-no-posts h2 {
    color: var(--hsd-text-dark);
    margin-bottom: 16px;
}

.hsd-no-posts p {
    color: var(--hsd-text-gray);
    margin-bottom: 24px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .hsd-content-grid {
        grid-template-columns: 1fr;
    }
    
    .hsd-content-sidebar {
        display: none;
    }
    
    .hsd-mobile-cta {
        display: block;
    }
}

@media (max-width: 768px) {
    .hsd-blog .hsd-container {
        padding: 0 20px;
    }
    
    .hsd-blog-hero {
        padding: 60px 0 40px;
    }
    
    .hsd-post-hero {
        min-height: 280px;
    }
    
    .hsd-hero-overlay {
        padding: 40px 0;
    }
    
    .hsd-post-title {
        font-size: 2rem;
    }
    
    .hsd-post-content {
        padding: 30px 0;
    }
    
    .hsd-post-content .hsd-container {
        padding: 25px;
    }
    
    .hsd-post-nav {
        grid-template-columns: 1fr;
    }
    
    .hsd-content-body {
        font-size: 16px;
    }
    
    .hsd-author-box {
        flex-direction: column;
        text-align: center;
    }
    
    .hsd-author-box img {
        margin: 0 auto;
    }
}

/* Focus States */
.hsd-blog a:focus,
.hsd-blog button:focus,
.hsd-blog input:focus,
.hsd-blog textarea:focus,
.hsd-blog select:focus {
    outline: 2px solid var(--hsd-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .hsd-blog-search,
    .hsd-blog-categories,
    .hsd-content-sidebar,
    .hsd-mobile-cta,
    .hsd-post-nav,
    .hsd-content-ad,
    .hsd-inline-ad {
        display: none !important;
    }
}