/* =================================================================
   Single Post & Page Styling v3.0
   ================================================================= */

/* --- 1.0 Main Content Centering & Layout --- */
/* This targets the main content area (#primary) specifically on single posts. 
   It centers the container on the page for a more balanced look on wide screens. */
.single-post #primary {
    max-width: 1100px; /* Set a max-width for the entire content area */
    margin: 0 auto;    /* Center the container */
    float: none;       /* Override default theme floats */
}

.tm-single-post-container {
    max-width: 800px; /* Optimal width for the article text itself */
    margin: 2rem auto;
    padding: 0 1rem;
}

.tm-single-post-article {
    background-color: #fff;
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 25px rgba(0,0,0,0.07);
}

@media (min-width: 768px) {
    .tm-single-post-article {
        padding: 3.5rem;
    }
}

/* --- 2.0 Breadcrumbs --- */
.tm-breadcrumbs {
    font-size: 0.9rem;
    color: var(--tm-light-text);
    margin-bottom: 1.5rem;
}
.tm-breadcrumbs a {
    color: var(--tm-primary);
    text-decoration: none;
    font-weight: 500;
}
.tm-breadcrumbs a:hover {
    text-decoration: underline;
}
.tm-breadcrumbs .current {
    color: var(--tm-dark-text);
    font-weight: 600;
}
.tm-breadcrumbs .fas {
    font-size: 0.7rem;
    margin: 0 0.5rem;
    vertical-align: middle;
}

/* --- 3.0 Entry Header --- */
.entry-header {
    margin-bottom: 2rem;
    text-align: left;
}

.tm-entry-meta-category {
    display: inline-block;
    background-color: transparent; /* Changed */
    color: var(--tm-accent); /* Changed */
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--tm-accent); /* Added border */
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}
.tm-entry-meta-category:hover {
    background-color: var(--tm-accent);
    color: #fff;
}

.entry-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--tm-dark-text, #1a202c);
    margin: 0.5rem 0;
}

@media (min-width: 768px) {
    .entry-title {
        font-size: 3rem;
    }
}

.tm-entry-meta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tm-border-color, #e2e8f0);
}
@media (min-width: 768px) {
    .tm-entry-meta-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.tm-entry-meta {
    color: var(--tm-light-text, #718096);
    font-size: 0.9rem;
}
.tm-entry-meta a {
    color: var(--tm-dark-text, #1a202c);
    text-decoration: none;
    font-weight: 600;
}
.tm-entry-meta a:hover {
    color: var(--tm-accent, #ff6600);
}
.tm-meta-separator {
    margin: 0 0.5rem;
}

/* --- 4.0 Share Feature --- */
.tm-share-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.tm-share-buttons {
    display: flex;
    gap: 0.5rem;
}
.tm-share-btn {
    background-color: #f1f5f9;
    color: #333;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}
.tm-share-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.tm-share-btn .fas { color: #3b82f6; }
.tm-share-btn.is-copied {
    background-color: #16a34a;
    color: white;
    border-color: #16a34a;
}
.tm-share-btn.is-copied .fas {
    color: white;
}

/* --- 5.0 Featured Image & Content --- */
.tm-post-thumbnail {
    margin: 2rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
}
.tm-post-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #3d3d3d;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
    margin-top: 2.5em;
    margin-bottom: 1em;
    line-height: 1.3;
    color: var(--tm-dark-text);
}
.entry-content p, .entry-content ul, .entry-content ol {
    margin-bottom: 1.5em;
}
.entry-content a {
    color: var(--tm-accent, #ff6600);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}
.entry-content a:hover {
    color: var(--tm-primary);
}

/* --- 6.0 Author Box --- */
.tm-author-box {
    margin-top: 3rem;
    padding: 2rem;
    background-color: var(--tm-bg-accent);
    border: 1px solid var(--tm-border-color, #e2e8f0);
    border-radius: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}
.tm-author-avatar img {
    border-radius: 50%;
}
.tm-author-info h4 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
}
.tm-author-info h4 a {
    color: var(--tm-dark-text);
    text-decoration: none;
}
.tm-author-info p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--tm-light-text);
}


/* --- 7.0 "You Might Also Like" Section (Related Posts) --- */
.tm-related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--tm-border-color, #e2e8f0);
}
.tm-related-posts h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: left;
    color: var(--tm-dark-text);
}
.tm-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
/* Style the cards within the related posts section */
.tm-related-posts .tm-post-card {
    border: 1px solid var(--tm-border-color);
    border-radius: 0.5rem;
}
/* Target the title link inside related post cards */
.tm-related-posts .tm-post-card .tm-post-card-title a {
    color: var(--tm-dark-text); /* Default link color */
    transition: color 0.2s ease-in-out;
}
/* Set the orange color ONLY on hover */
.tm-related-posts .tm-post-card:hover .tm-post-card-title a {
    color: var(--tm-accent);
}
/* Style the category link on related posts */
.tm-related-posts .tm-post-card-meta a {
    color: var(--tm-light-text);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}
.tm-related-posts .tm-post-card:hover .tm-post-card-meta a {
    color: var(--tm-accent);
}
