/* =========================================================
   BLOG STYLES — Greg Marrs theme
   Inherits all skin variables (--primary, --accent, --bg,
   --bg-alt, --border, --dark, --text, --text-light, --radius,
   --radius-lg, --shadow, --shadow-lg, --max-width).
   Works with all light skins and noir-* dark skins.
   ========================================================= */

/* ---------- Layout ---------- */
.blog-section { padding: 48px 0 64px; }
.blog-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}
.blog-main { min-width: 0; }

/* ---------- Page hero tweaks for blog ---------- */
.post-hero .post-hero-cat {
    display: inline-block;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.post-hero .post-hero-cat a {
    display: inline-block;
    background: var(--accent);
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.post-hero .post-hero-cat a:hover { background: var(--accent-hover); }
.post-hero h1 { max-width: 820px; }
.post-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
    font-size: .9rem;
    color: rgba(255,255,255,.8);
    position: relative;
    z-index: 1;
}
.post-hero-meta .post-meta-sep { opacity: .5; }

/* light-skin breadcrumb adjustments — match existing skin overrides */
body.skin-professional .post-hero-meta,
body.skin-sapphire .post-hero-meta,
body.skin-coral-red .post-hero-meta,
body.skin-green .post-hero-meta,
body.skin-salmon .post-hero-meta,
body.skin-cyan .post-hero-meta { color: var(--text-light); }

/* ---------- Featured image (single) ---------- */
.post-featured-image {
    margin: 28px 0 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Post list / cards ---------- */
.post-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.post-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.post-card-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-body { padding: 24px 26px 26px; }
.post-card-title {
    margin: 8px 0 10px;
    font-size: 1.4rem;
    line-height: 1.3;
}
.post-card-title a { color: var(--dark); }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt p {
    color: var(--text-light);
    font-size: .95rem;
    margin-bottom: 14px;
}
.post-meta {
    font-size: .82rem;
    color: var(--text-light);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.post-meta .post-meta-sep { opacity: .5; }
.post-meta-cat {
    color: var(--accent) !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .78rem;
}
.post-meta-cat:hover { color: var(--accent-hover) !important; }
.post-read-more { display: inline-block; margin-top: 4px; }

/* ---------- Pagination ---------- */
.blog-pagination { margin-top: 40px; }
.blog-pagination .nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-weight: 600;
    font-size: .9rem;
    transition: all .2s;
}
.blog-pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.blog-pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.blog-pagination .page-numbers.dots { border: none; background: transparent; }

/* ---------- Single post content typography ---------- */
.single-post .post-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--text);
}
.single-post .post-content p { margin-bottom: 22px; }
.single-post .post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    margin: 44px 0 16px;
    color: var(--dark);
}
.single-post .post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin: 32px 0 12px;
    color: var(--dark);
}
.single-post .post-content h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 24px 0 10px;
    color: var(--dark);
}
.single-post .post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.single-post .post-content a:hover { color: var(--accent-hover); }
.single-post .post-content ul,
.single-post .post-content ol {
    margin: 0 0 22px 24px;
    line-height: 1.9;
}
.single-post .post-content li { margin-bottom: 6px; }
.single-post .post-content blockquote {
    margin: 28px 0;
    padding: 20px 26px;
    border-left: 4px solid var(--accent);
    background: var(--bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text);
}
.single-post .post-content blockquote p:last-child { margin-bottom: 0; }
.single-post .post-content img {
    display: block;
    margin: 28px auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    max-width: 100%;
    height: auto;
}
.single-post .post-content code {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.single-post .post-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 18px 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 22px 0;
    font-size: .9rem;
}
.single-post .post-content pre code {
    background: none;
    border: none;
    padding: 0;
}

/* ---------- Tags / share / author ---------- */
.post-tags,
.post-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 32px 0 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: .88rem;
}
.post-tags-label,
.post-share-label {
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: .78rem;
}
.post-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-size: .82rem;
    transition: all .2s;
}
.post-tag:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.post-share-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    font-size: .82rem;
    transition: all .2s;
}
.post-share-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.author-bio {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 40px 0 0;
    padding: 26px 28px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.author-bio-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    box-shadow: var(--shadow);
}
.author-bio-body { flex: 1; min-width: 0; }
.author-bio-body h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: var(--dark);
}
.author-bio-body p {
    margin: 0;
    color: var(--text-light);
    font-size: .92rem;
    line-height: 1.7;
}

/* ---------- Related posts ---------- */
.related-posts { margin: 56px 0 0; }
.related-posts h2 {
    font-size: 1.5rem;
    margin: 0 0 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.related-card { padding: 0; overflow: hidden; }
.related-card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-alt);
}
.related-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card-body { padding: 18px 20px 22px; }
.related-card-body h3 {
    margin: 8px 0 0;
    font-size: 1.05rem;
    line-height: 1.35;
}
.related-card-body h3 a { color: var(--dark); }
.related-card-body h3 a:hover { color: var(--accent); }

/* ---------- Comments ---------- */
.post-comments {
    margin: 56px 0 0;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.post-comments .comments-title {
    font-size: 1.4rem;
    margin: 0 0 20px;
}
.post-comments ol.comment-list { list-style: none; margin: 0; padding: 0; }
.post-comments .comment-body {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 18px;
}
.post-comments .comment-author { font-weight: 700; color: var(--dark); }
.post-comments .comment-meta { font-size: .82rem; color: var(--text-light); margin-bottom: 10px; }
.post-comments .comment-content p { margin-bottom: 10px; }
.post-comments .comment-respond { margin-top: 28px; }
.post-comments input[type="text"],
.post-comments input[type="email"],
.post-comments input[type="url"],
.post-comments textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    margin-bottom: 12px;
}
.post-comments .form-submit input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.post-comments .form-submit input[type="submit"]:hover { background: var(--accent-hover); }

/* ---------- Sidebar ---------- */
.blog-sidebar { min-width: 0; }
.sidebar-sticky {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 22px 20px;
    transition: border-color .2s;
}
.widget-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .05em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.widget-empty { color: var(--text-light); font-size: .88rem; margin: 0; }

/* Search widget */
.widget-search form { display: flex; gap: 6px; }
.widget-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
}
.widget-search input[type="submit"],
.widget-search button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0 16px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
}
.widget-search input[type="submit"]:hover,
.widget-search button[type="submit"]:hover { background: var(--accent-hover); }

/* Recent / popular post lists */
.widget-post-list { list-style: none; margin: 0; padding: 0; }
.widget-post-list li { margin: 0 0 12px; }
.widget-post-list li:last-child { margin-bottom: 0; }
.widget-post-link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--text);
    transition: color .2s;
}
.widget-post-link:hover { color: var(--accent); }
.widget-post-thumb {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-alt);
    border: 1px solid var(--border);
}
.widget-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.widget-post-thumb-placeholder { background: var(--bg-alt); }
.widget-post-meta { display: flex; flex-direction: column; min-width: 0; }
.widget-post-title {
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.4;
    color: var(--dark);
    display: block;
}
.widget-post-link:hover .widget-post-title { color: var(--accent); }
.widget-post-date {
    margin-top: 4px;
    font-size: .75rem;
    color: var(--text-light);
}

/* Categories */
.widget-cat-list { list-style: none; margin: 0; padding: 0; }
.widget-cat-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: .9rem;
}
.widget-cat-list li:last-child { border-bottom: none; }
.widget-cat-list a { color: var(--text); }
.widget-cat-list a:hover { color: var(--accent); }
.widget-cat-count {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 1px 8px;
    border-radius: 50px;
    font-size: .72rem;
    font-weight: 700;
}

/* Tag cloud */
.widget-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.widget-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: .78rem;
    color: var(--text);
    transition: all .2s;
}
.widget-tag:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* No-posts / search-form wrap */
.no-posts {
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
}
.no-posts h2 { margin-top: 0; }
.search-form-wrap { margin: 0 0 24px; }
.search-form-wrap form { display: flex; gap: 8px; }
.search-form-wrap input[type="search"] {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.search-form-wrap input[type="submit"],
.search-form-wrap button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0 22px;
    border-radius: var(--radius);
    font-weight: 700;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .sidebar-sticky { position: static; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .related-grid { grid-template-columns: 1fr; }
    .post-card-body { padding: 20px 20px 22px; }
    .post-card-title { font-size: 1.2rem; }
    .single-post .post-content { font-size: 1rem; }
    .single-post .post-content h2 { font-size: 1.45rem; }
    .author-bio { flex-direction: column; }
    .author-bio-avatar img { width: 64px; height: 64px; }
}

/* =========================================================
   DARK SKIN OVERRIDES — noir-* skins
   The CSS variables already cover bg/text/border, but a few
   spots need stronger styling for contrast.
   ========================================================= */
body[class*="skin-noir-"] .post-card-title a,
body[class*="skin-noir-"] .related-card-body h3 a,
body[class*="skin-noir-"] .author-bio-body h3,
body[class*="skin-noir-"] .widget-title,
body[class*="skin-noir-"] .widget-post-title,
body[class*="skin-noir-"] .single-post .post-content h2,
body[class*="skin-noir-"] .single-post .post-content h3,
body[class*="skin-noir-"] .single-post .post-content h4 { color: #edebe9; }

body[class*="skin-noir-"] .post-card,
body[class*="skin-noir-"] .related-card,
body[class*="skin-noir-"] .widget,
body[class*="skin-noir-"] .author-bio {
    background: #0f1117;
    border-color: #222630;
}
body[class*="skin-noir-"] .post-card:hover,
body[class*="skin-noir-"] .related-card:hover { border-color: var(--accent); }

body[class*="skin-noir-"] .single-post .post-content { color: #cfd2d8; }
body[class*="skin-noir-"] .single-post .post-content blockquote {
    background: #0f1117;
    border-left-color: var(--accent);
    color: #edebe9;
}
body[class*="skin-noir-"] .single-post .post-content code,
body[class*="skin-noir-"] .single-post .post-content pre {
    background: #0a0c12;
    border-color: #222630;
    color: #edebe9;
}

body[class*="skin-noir-"] .blog-pagination .page-numbers {
    background: #0f1117;
    border-color: #222630;
    color: #edebe9;
}
body[class*="skin-noir-"] .blog-pagination a.page-numbers:hover,
body[class*="skin-noir-"] .blog-pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #080a0f;
}

body[class*="skin-noir-"] .post-tag,
body[class*="skin-noir-"] .post-share-btn,
body[class*="skin-noir-"] .widget-tag,
body[class*="skin-noir-"] .widget-cat-count {
    background: #0a0c12;
    border-color: #222630;
    color: #edebe9;
}
body[class*="skin-noir-"] .post-tag:hover,
body[class*="skin-noir-"] .post-share-btn:hover,
body[class*="skin-noir-"] .widget-tag:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #080a0f;
}

body[class*="skin-noir-"] .widget-search input[type="search"],
body[class*="skin-noir-"] .search-form-wrap input[type="search"],
body[class*="skin-noir-"] .post-comments input,
body[class*="skin-noir-"] .post-comments textarea {
    background: #0a0c12;
    border-color: #222630;
    color: #edebe9;
}

body[class*="skin-noir-"] .no-posts {
    background: #0f1117;
    border-color: #222630;
}

body[class*="skin-noir-"] .post-meta,
body[class*="skin-noir-"] .post-card-excerpt p,
body[class*="skin-noir-"] .author-bio-body p,
body[class*="skin-noir-"] .widget-post-date,
body[class*="skin-noir-"] .widget-empty,
body[class*="skin-noir-"] .post-tags-label,
body[class*="skin-noir-"] .post-share-label { color: #8a8f9a; }
