/**
 * Single Post Template - FULL WIDTH VERSION
 * Optimized for readability with proper content width
 * 
 * @package The History of Healing
 */

/* ========================================
   CSS VARIABLES
   ======================================== */

:root {
    --primary-color: #2C5F8D;
    --secondary-color: #8B4513;
    --accent-color: #D4AF37;
    --text-primary: #1a1a1a;
    --text-secondary: #2a2a2a;
    --text-body: #4a4a4a;
    --text-muted: #5a5a5a;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-accent: #e8f4f8;
    --border-light: #e5e5e5;
    --font-primary: 'Merriweather', Georgia, serif;
    --font-heading: 'Playfair Display', Georgia, serif;
}

/* ========================================
   PROGRESS BAR
   ======================================== */

.hoh-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--border-light);
    z-index: 10000;
}

.hoh-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.1s ease;
}

/* ========================================
   MAIN CONTAINER - FULL WIDTH
   ======================================== */

.hoh-blog-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 60px 40px !important;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 80px;
    font-family: var(--font-primary);
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* ========================================
   SIDEBAR
   ======================================== */

.hoh-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
    align-self: start;
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    box-sizing: border-box;
}

.hoh-sidebar-toc {
    background-color: var(--bg-white);
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.hoh-sidebar-toc h3 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 20px 0;
}

.hoh-toc-item {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: left;
    padding: 12px 0 12px 16px;
    border: none;
    background: none;
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    text-decoration: none;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    hyphens: auto;
    box-sizing: border-box;
}

.hoh-toc-item:hover,
.hoh-toc-item.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
    background-color: var(--bg-light);
}

.hoh-toc-generated {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hoh-toc-empty {
    font-size: 13px;
    color: #999;
    font-style: italic;
    padding: 12px 0;
    margin: 0;
}

.hoh-sidebar-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 32px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(44, 95, 141, 0.25);
    color: white;
}

.hoh-sidebar-cta h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
}

.hoh-sidebar-cta p {
    font-size: 14px;
    margin: 0 0 20px 0;
    color: white;
    opacity: 0.95;
    line-height: 1.6;
}

.hoh-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: white;
    color: var(--primary-color);
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-primary);
}

.hoh-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* ========================================
   ARTICLE - PROPER READING WIDTH
   ======================================== */

.hoh-article {
    background-color: var(--bg-white);
    padding: 60px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 100% !important;
    width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
}

/* Content inside article has max-width for readability */
.hoh-article > * {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* FAQ Schema Markup - Force wrapping */
.hoh-article [itemtype*="schema.org/Question"],
.hoh-article [itemtype*="schema.org/Answer"],
.hoh-article [itemprop="text"],
.hoh-article [itemprop="name"],
.hoh-article [itemprop="acceptedAnswer"] {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.hoh-article [itemprop="text"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* Handle non-breaking spaces */
    word-spacing: normal;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
}

/* All divs inside article */
.hoh-article div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* Force breaking of long words and non-breaking spaces */
.hoh-article {
    overflow-wrap: anywhere;
    word-break: normal;
}

.hoh-article * {
    overflow-wrap: anywhere;
}

/* Full width elements */
.hoh-article .hoh-featured-image,
.hoh-article .hoh-next-steps,
.hoh-article .hoh-related-posts {
    max-width: 100% !important;
}

.hoh-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    align-items: center;
}

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

.hoh-meta svg {
    vertical-align: middle;
}

.hoh-meta a {
    color: inherit;
    text-decoration: none;
}

.hoh-meta a:hover {
    color: var(--primary-color);
}

.hoh-article h1 {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 24px 0;
    color: var(--text-primary);
}

.hoh-intro {
    font-size: 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 24px 0;
    font-weight: 400;
}

.hoh-author-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 2px solid var(--border-light);
    margin-bottom: 48px;
}

.hoh-author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.hoh-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hoh-author-details h5 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.hoh-author-details h5 a {
    color: inherit;
    text-decoration: none;
}

.hoh-author-details h5 a:hover {
    color: var(--primary-color);
}

.hoh-author-details p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.hoh-featured-image {
    margin: 32px 0;
    border-radius: 8px;
    overflow: hidden;
}

.hoh-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   CONTENT
   ======================================== */

.hoh-content {
    max-width: 850px !important;
}

.hoh-content h2 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    margin: 60px 0 24px 0;
    color: var(--text-primary);
    line-height: 1.3;
    scroll-margin-top: 100px;
}

.hoh-content h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 20px 0;
    color: var(--text-secondary);
    line-height: 1.3;
}

.hoh-content h4 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 36px 0 16px 0;
    color: var(--text-secondary);
}

.hoh-content p {
    font-size: 18px;
    color: var(--text-body);
    line-height: 1.8;
    margin: 0 0 24px 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.hoh-content p a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--primary-color);
    transition: all 0.2s ease;
}

.hoh-content p a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

.hoh-content ul,
.hoh-content ol {
    margin: 0 0 24px 0;
    padding-left: 32px;
}

.hoh-content li {
    font-size: 18px;
    color: var(--text-body);
    line-height: 1.8;
    margin: 0 0 12px 0;
}

.hoh-content blockquote {
    background: var(--bg-accent);
    border-left: 4px solid var(--primary-color);
    padding: 24px 28px;
    margin: 32px 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.hoh-content blockquote p {
    font-size: 19px;
    color: var(--text-secondary);
    margin: 0;
}

.hoh-content img {
    max-width: 100% !important;
    height: auto !important;
    width: auto;
    border-radius: 8px;
    margin: 32px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: block;
}

.hoh-content figure {
    margin: 32px 0;
}

.hoh-content figcaption {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    font-style: italic;
}

/* ========================================
   TAGS
   ======================================== */

.hoh-tags {
    margin: 40px 0 0 0;
    padding: 32px 0 0 0;
    border-top: 1px solid var(--border-light);
}

.hoh-tags strong {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin: 0 0 12px 0;
}

.hoh-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hoh-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--bg-light);
    color: var(--text-body);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hoh-tag:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   NEXT STEPS / CTA SECTION
   ======================================== */

.hoh-next-steps {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 48px;
    border-radius: 16px;
    margin: 80px 0 0 0;
}

.hoh-next-steps h2 {
    font-family: var(--font-heading);
    font-size: 38px;
    color: white;
    margin: 0 0 16px 0;
}

.hoh-next-steps-subtitle {
    font-size: 18px;
    margin: 0 0 48px 0;
    opacity: 0.95;
    color: white;
}

.hoh-next-steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.hoh-step-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hoh-step-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.hoh-step-card.featured {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hoh-step-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 20px 0;
    transition: all 0.3s ease;
}

.hoh-step-card:hover .hoh-step-icon {
    transform: scale(1.1);
}

.hoh-step-card.featured .hoh-step-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.hoh-step-card:not(.featured) .hoh-step-icon {
    background: rgba(255, 255, 255, 0.2);
}

.hoh-step-card h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
}

.hoh-step-card.featured h3 {
    color: var(--text-primary);
}

.hoh-step-card:not(.featured) h3 {
    color: #ffffff;
}

.hoh-step-card p {
    font-size: 15px;
    margin: 0 0 20px 0;
    opacity: 0.95;
}

.hoh-step-card.featured p {
    color: var(--text-body);
}

.hoh-step-card:not(.featured) p {
    color: #ffffff;
}

.hoh-btn-white,
.hoh-btn-outline-white {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
    text-decoration: none;
}

.hoh-btn-white {
    background: white;
    color: var(--primary-color);
    border: none;
}

.hoh-btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.hoh-btn-outline-white {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.hoh-btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

/* ========================================
   RELATED POSTS
   ======================================== */

.hoh-related-posts {
    margin: 60px 0 0 0;
    padding: 60px 0 0 0;
    border-top: 2px solid var(--border-light);
}

.hoh-related-posts h3 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 32px 0;
    color: var(--text-primary);
}

.hoh-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.hoh-related-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

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

.hoh-related-thumb {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.hoh-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin: 0 !important;
    border-radius: 0 !important;
}

.hoh-related-card:hover .hoh-related-thumb img {
    transform: scale(1.05);
}

.hoh-related-content {
    padding: 24px;
}

.hoh-related-content h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    line-height: 1.4;
}

.hoh-related-content p {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   AUTHOR BIO
   ======================================== */

.hoh-author-bio {
    margin: 60px 0 0 0;
    padding: 32px;
    background: var(--bg-light);
    border-radius: 12px;
}

.hoh-author-bio-inner {
    display: flex;
    gap: 24px;
    align-items: start;
}

.hoh-author-bio-avatar {
    flex-shrink: 0;
}

.hoh-author-bio-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.hoh-author-bio-content h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.hoh-author-bio-content p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-body);
    margin: 0 0 16px 0;
}

.hoh-author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.hoh-author-link:hover {
    color: var(--secondary-color);
}

/* ========================================
   RESPONSIVE - MOBILE FIRST
   ======================================== */

@media (max-width: 1200px) {
    .hoh-blog-container {
        gap: 60px;
        padding: 50px 30px !important;
    }
    
    .hoh-sidebar {
        width: 280px;
    }
}

@media (max-width: 968px) {
    .hoh-blog-container {
        grid-template-columns: 1fr !important;
        gap: 40px;
        padding: 40px 24px !important;
        overflow-x: hidden;
    }

    .hoh-sidebar {
        position: relative;
        top: 0;
        order: -1;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .hoh-article {
        padding: 40px 30px;
        overflow: hidden;
    }
    
    /* Force wrapping on all article content */
    .hoh-article * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* FAQ schema on mobile */
    .hoh-article [itemtype*="schema.org"],
    .hoh-article [itemprop] {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    .hoh-article h1 {
        font-size: 36px;
    }

    .hoh-content h2 {
        font-size: 32px;
    }

    .hoh-next-steps-grid {
        grid-template-columns: 1fr;
    }

    .hoh-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hoh-blog-container {
        padding: 32px 20px !important;
        overflow-x: hidden !important;
        width: 100%;
    }

    .hoh-article {
        padding: 32px 24px;
        overflow: hidden !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Aggressive wrapping for all content */
    .hoh-article,
    .hoh-article *,
    .hoh-article [itemscope],
    .hoh-article [itemprop],
    .hoh-article div,
    .hoh-article p,
    .hoh-article span {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        hyphens: auto !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .hoh-article h1 {
        font-size: 32px;
    }

    .hoh-intro {
        font-size: 18px;
    }

    .hoh-content h2 {
        font-size: 28px;
    }

    .hoh-content p {
        font-size: 16px;
    }

    .hoh-next-steps {
        padding: 40px 24px;
    }

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

    .hoh-author-bio-inner {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

/* Extra small devices - 480px and below */
@media (max-width: 480px) {
    .hoh-blog-container {
        padding: 24px 16px !important;
        overflow-x: hidden !important;
    }
    
    .hoh-article {
        padding: 24px 16px;
        overflow: hidden !important;
    }
    
    /* Ultra aggressive wrapping for tiny screens */
    .hoh-article * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .hoh-article h1 {
        font-size: 28px;
        line-height: 1.3;
    }
    
    .hoh-content h2 {
        font-size: 24px;
    }
    
    .hoh-content h3 {
        font-size: 20px;
    }
}

/* Minimum device width - 375px */
@media (max-width: 375px) {
    .hoh-blog-container {
        padding: 20px 12px !important;
    }
    
    .hoh-article {
        padding: 20px 12px;
        overflow-x: hidden !important;
    }
    
    .hoh-article h1 {
        font-size: 24px;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .hoh-progress-bar,
    .hoh-sidebar,
    .hoh-next-steps,
    .hoh-related-posts {
        display: none;
    }

    .hoh-blog-container {
        grid-template-columns: 1fr;
    }

    .hoh-article {
        box-shadow: none;
        padding: 0;
    }
}
