/**
 * Frontend Article Styles
 * Ensures articles created via dashboard display properly
 */

/* Single Post/Article Spacing */
.single-post .entry-header,
.single .entry-header,
article.post .entry-header,
article.single .entry-header {
    margin-bottom: 30px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid #e5e7eb;
}

/* Post Title Visibility - MAXIMUM FORCE */
.single-post .entry-title,
.single .entry-title,
article.post h1.entry-title,
article.single h1.entry-title,
.post h1,
.single h1.post-title,
.single-post h1,
.single article h1,
.single .post-title,
.single-post .post-title,
body.single h1.entry-title,
body.single-post h1.entry-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 2.5em !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-top: 0 !important;
    margin-bottom: 25px !important;
    padding-bottom: 0 !important;
    color: #1a202c !important;
    max-height: none !important;
    overflow: visible !important;
    clip: auto !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
}

/* Force show title even if theme tries to hide it */
.single .entry-header .entry-title,
.single-post .entry-header .entry-title {
    display: block !important;
    visibility: visible !important;
}

/* Post Meta (date, author, etc.) */
.single-post .entry-meta,
.single .entry-meta,
article.post .entry-meta,
.post-meta {
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    font-size: 0.9em;
    color: #6b7280;
}

/* Post Content Spacing */
.single-post .entry-content,
.single .entry-content,
article.post .entry-content,
article.single .entry-content,
.post-content,
.article-content {
    margin-top: 30px !important;
    margin-bottom: 40px !important;
    padding: 30px 0 !important;
    font-size: 1.1em;
    line-height: 1.8;
    color: #374151;
}

/* Content Paragraphs */
.entry-content p,
.post-content p,
.article-content p {
    margin-bottom: 1.5em !important;
    line-height: 1.8;
}

/* Content Headings */
.entry-content h2,
.post-content h2 {
    font-size: 1.8em !important;
    font-weight: 700 !important;
    margin-top: 2em !important;
    margin-bottom: 1em !important;
    color: #1a202c !important;
}

.entry-content h3,
.post-content h3 {
    font-size: 1.4em !important;
    font-weight: 600 !important;
    margin-top: 1.5em !important;
    margin-bottom: 0.8em !important;
    color: #1a202c !important;
}

/* Content Lists */
.entry-content ul,
.entry-content ol,
.post-content ul,
.post-content ol {
    margin: 1.5em 0 !important;
    padding-left: 2em !important;
}

.entry-content li,
.post-content li {
    margin-bottom: 0.5em !important;
    line-height: 1.6;
}

/* Featured Image */
.single-post .post-thumbnail,
.single .post-thumbnail,
article.post .post-thumbnail {
    margin-bottom: 30px !important;
}

.single-post .post-thumbnail img,
.single .post-thumbnail img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
}

/* Post Footer */
.single-post .entry-footer,
.single .entry-footer,
article.post .entry-footer {
    margin-top: 40px !important;
    padding-top: 30px !important;
    border-top: 1px solid #e5e7eb;
}

/* Archive/Blog Layout */
.archive .site-main,
.blog .site-main,
.search .site-main {
    padding-top: 30px !important;
}

.archive article,
.blog article,
.search article {
    margin-bottom: 50px !important;
    padding-bottom: 40px !important;
    border-bottom: 1px solid #e5e7eb;
}

.archive article:last-child,
.blog article:last-child {
    border-bottom: none;
}

/* Excerpt Spacing */
.archive .entry-summary,
.blog .entry-summary,
.search .entry-summary {
    margin-top: 15px !important;
    margin-bottom: 20px !important;
}

/* Read More Link */
.archive .more-link,
.blog .more-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: #2e94f4;
    color: white !important;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.archive .more-link:hover,
.blog .more-link:hover {
    background: #1a7dd6;
}

/* Container/Wrapper Spacing */
.single-post .site-content,
.single .site-content {
    padding: 40px 20px !important;
}

@media (min-width: 768px) {
    .single-post .site-content,
    .single .site-content {
        padding: 60px 40px !important;
    }
}

/* Ensure main content area has breathing room */
.single-post main,
.single main,
article.post,
article.single {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
}

@media (min-width: 768px) {
    .single-post main,
    .single main,
    article.post,
    article.single {
        padding: 40px 20px;
    }
}

/* Fix for themes with tight spacing */
body.single-post,
body.single {
    background: #f9fafb;
}

.single-post .entry-content > *:first-child,
.single .entry-content > *:first-child {
    margin-top: 0 !important;
}

.single-post .entry-content > *:last-child,
.single .entry-content > *:last-child {
    margin-bottom: 0 !important;
}

/* Category & Tag Links */
.cat-links,
.tags-links {
    display: block;
    margin: 10px 0;
}

.cat-links a,
.tags-links a {
    display: inline-block;
    padding: 5px 12px;
    margin: 5px 5px 5px 0;
    background: #f3f4f6;
    color: #374151 !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.2s ease;
}

.cat-links a:hover,
.tags-links a:hover {
    background: #e5e7eb;
}

/* Blockquotes */
.entry-content blockquote,
.post-content blockquote {
    margin: 2em 0 !important;
    padding: 20px 30px !important;
    background: #f9fafb;
    border-left: 4px solid #2e94f4;
    font-style: italic;
    color: #4b5563;
}

/* Images in Content */
.entry-content img,
.post-content img {
    max-width: 100% !important;
    height: auto !important;
    margin: 2em 0 !important;
    border-radius: 8px;
}

/* Tables */
.entry-content table,
.post-content table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
}

.entry-content table th,
.entry-content table td,
.post-content table th,
.post-content table td {
    padding: 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.entry-content table th,
.post-content table th {
    background: #f9fafb;
    font-weight: 600;
}

/* Code Blocks */
.entry-content pre,
.post-content pre {
    padding: 20px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2em 0;
}

.entry-content code,
.post-content code {
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.entry-content pre code,
.post-content pre code {
    padding: 0;
    background: transparent;
}
