/*
Theme Name: Niche
Version: 1.3.1
Text Domain: niche
Description: Modern SaaS-style project management and productivity blog theme with clean indigo design.
Author: Theme Developer
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
*/

:root {
    --niche-primary: #6366f1;
    --niche-secondary: #1e1b4b;
    --niche-accent: #10b981;
    --niche-text: #1f2937;
    --niche-text-light: #6b7280;
    --niche-bg: #ffffff;
    --niche-bg-alt: #f9fafb;
    --niche-border: #e5e7eb;
    --niche-font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --niche-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --niche-transition: 0.2s ease;
    --niche-radius: 0.5rem;
    --niche-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --niche-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--niche-font-body); font-size: 1rem; line-height: 1.6; color: var(--niche-text); background: var(--niche-bg); overflow-x: hidden; }
a { color: var(--niche-primary); text-decoration: none; transition: color var(--niche-transition); }
a:hover { color: var(--niche-secondary); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-family: var(--niche-font-heading); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; color: var(--niche-secondary); }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
p { margin: 0 0 1.25em; }

.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed; top: 5px; left: 5px; width: auto; height: auto; padding: 15px 23px; clip: auto; font-size: 0.875rem; font-weight: 700; background: #f1f1f1; color: #21759b; z-index: 100000; }
.niche-skip-link { position: absolute; top: -100px; left: 0; padding: 1rem 1.5rem; background: var(--niche-primary); color: #fff; font-weight: 600; z-index: 99999; transition: top var(--niche-transition); border-radius: 0 0 var(--niche-radius) 0; }
.niche-skip-link:focus { top: 0; color: #fff; }

.niche-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.niche-header { background: var(--niche-bg); position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--niche-border); }
.niche-header-scrolled { box-shadow: var(--niche-shadow); }
.niche-header-hidden { transform: translateY(-100%); }
.niche-header-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.niche-logo { font-size: 1.5rem; font-weight: 800; color: var(--niche-secondary); display: flex; align-items: center; gap: 0.5rem; }
.niche-logo:hover { color: var(--niche-primary); }
.niche-logo img, .niche-logo .custom-logo { max-height: 50px; width: auto; height: auto; }
.niche-logo-icon { width: 2rem; height: 2rem; background: linear-gradient(135deg, var(--niche-primary), var(--niche-accent)); border-radius: 0.375rem; display: flex; align-items: center; justify-content: center; }
.niche-logo-icon svg { width: 1.25rem; height: 1.25rem; fill: #fff; }

.niche-nav { display: flex; align-items: center; gap: 0.5rem; }
.niche-nav-menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.25rem; }
.niche-nav-menu a { display: block; padding: 0.5rem 1rem; color: var(--niche-text); font-size: 0.9375rem; font-weight: 500; border-radius: var(--niche-radius); }
.niche-nav-menu a:hover { color: var(--niche-primary); background: var(--niche-bg-alt); }
.niche-nav-menu .current-menu-item > a { color: var(--niche-primary); background: rgba(99, 102, 241, 0.1); }
.niche-menu-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--niche-text); border-radius: var(--niche-radius); }
.niche-menu-toggle:hover { background: var(--niche-bg-alt); }
.niche-menu-toggle svg { width: 1.5rem; height: 1.5rem; stroke: currentColor; fill: none; }
.niche-menu-close-item { display: none; }
.niche-menu-close { background: none; border: none; font-size: 1.75rem; line-height: 1; cursor: pointer; color: var(--niche-text-light); padding: 0.25rem 0.5rem; border-radius: var(--niche-radius); }
.niche-menu-close:hover { color: var(--niche-primary); background: var(--niche-bg-alt); }
.niche-menu-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 999; }
.niche-menu-overlay.niche-overlay-active { display: block; }

.niche-search-toggle { background: none; border: none; padding: 0.5rem; cursor: pointer; color: var(--niche-text-light); border-radius: var(--niche-radius); }
.niche-search-toggle:hover { color: var(--niche-primary); background: var(--niche-bg-alt); }
.niche-search-toggle svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; }
.niche-search-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(30,27,75,0.9); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding-top: 20vh; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.niche-search-overlay.niche-search-open { opacity: 1; visibility: visible; }
.niche-search-form { width: 100%; max-width: 600px; padding: 2rem; }
.niche-search-form input[type="search"] { width: 100%; padding: 1rem 1.5rem; font-size: 1.25rem; border: none; border-radius: var(--niche-radius); background: var(--niche-bg); color: var(--niche-text); outline: none; }
.niche-search-form input[type="search"]::placeholder { color: var(--niche-text-light); }
.niche-search-close { position: absolute; top: 2rem; right: 2rem; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; opacity: 0.7; }
.niche-search-close:hover { opacity: 1; }

.niche-content { padding: 2rem 0; min-height: 50vh; }
.niche-layout { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.niche-layout.right-sidebar { grid-template-columns: 1fr 320px; }
.niche-layout.left-sidebar { grid-template-columns: 320px 1fr; }
.niche-layout.left-sidebar .niche-sidebar { order: -1; }
.niche-main { min-width: 0; }

.niche-breadcrumbs { padding: 0.75rem 0; margin-bottom: 1.5rem; font-size: 0.875rem; color: var(--niche-text-light); }
.niche-breadcrumbs-list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.niche-breadcrumbs-list li::after { content: "/"; margin-left: 0.5rem; color: var(--niche-border); }
.niche-breadcrumbs-list li:last-child::after { display: none; }
.niche-breadcrumbs a { color: var(--niche-text-light); }
.niche-breadcrumbs a:hover { color: var(--niche-primary); }

.niche-article-card { display: flex; flex-direction: column; background: var(--niche-bg); border: 1px solid var(--niche-border); border-radius: var(--niche-radius); overflow: hidden; transition: all var(--niche-transition); }
.niche-article-card:hover { box-shadow: var(--niche-shadow-lg); border-color: transparent; transform: translateY(-2px); }
.niche-article-thumb { position: relative; overflow: hidden; aspect-ratio: 16/9; }
.niche-article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.niche-article-card:hover .niche-article-thumb img { transform: scale(1.05); }
.niche-article-category { position: absolute; top: 1rem; left: 1rem; background: var(--niche-primary); color: #fff; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; }
.niche-article-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.niche-article-meta { display: flex; gap: 0.75rem; font-size: 0.8125rem; color: var(--niche-text-light); margin-bottom: 0.75rem; }
.niche-article-meta svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; margin-right: 0.25rem; vertical-align: -2px; }
.niche-article-title { font-size: 1.125rem; margin-bottom: 0.75rem; line-height: 1.4; flex-grow: 1; }
.niche-article-title a { color: var(--niche-secondary); }
.niche-article-title a:hover { color: var(--niche-primary); }
.niche-article-excerpt { color: var(--niche-text-light); font-size: 0.9375rem; line-height: 1.6; margin-bottom: 1rem; }
.niche-article-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--niche-border); }
.niche-article-author { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.niche-article-author img { width: 1.75rem; height: 1.75rem; border-radius: 50%; }
.niche-article-read-more { color: var(--niche-primary); font-size: 0.875rem; font-weight: 600; }
.niche-article-read-more:hover { color: var(--niche-secondary); }
.niche-sticky-badge { display: inline-flex; align-items: center; gap: 0.375rem; background: linear-gradient(135deg, var(--niche-primary), var(--niche-accent)); color: #fff; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 600; border-radius: 9999px; margin-bottom: 0.75rem; }
.niche-sticky-badge svg { width: 0.875rem; height: 0.875rem; fill: currentColor; }

.niche-articles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.niche-articles-grid.grid-3col { grid-template-columns: repeat(3, 1fr); }
.niche-articles-grid.grid-2col { grid-template-columns: repeat(2, 1fr); }
.niche-articles-grid.grid-list { grid-template-columns: 1fr; }
.niche-articles-grid.grid-list .niche-article-card { flex-direction: row; }
.niche-articles-grid.grid-list .niche-article-thumb { flex: 0 0 300px; aspect-ratio: 16/10; }
.niche-articles-grid.grid-list .niche-article-body { flex: 1; }
.niche-featured-article { margin-bottom: 2rem; }
.niche-featured-article .niche-article-card { flex-direction: row; }
.niche-featured-article .niche-article-thumb { flex: 0 0 50%; aspect-ratio: auto; }
.niche-featured-article .niche-article-thumb img { height: 100%; min-height: 320px; }
.niche-featured-article .niche-article-body { padding: 2rem; justify-content: center; }
.niche-featured-article .niche-article-title { font-size: 1.75rem; }


.niche-single-header { margin-bottom: 2rem; }
.niche-single-categories { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.niche-single-category { display: inline-block; background: rgba(99, 102, 241, 0.1); color: var(--niche-primary); padding: 0.25rem 0.75rem; font-size: 0.8125rem; font-weight: 600; border-radius: 9999px; }
.niche-single-category:hover { background: var(--niche-primary); color: #fff; }
.niche-single-title { font-size: 2.5rem; margin-bottom: 1.25rem; line-height: 1.2; }
.niche-single-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; font-size: 0.9375rem; color: var(--niche-text-light); padding-bottom: 1.5rem; border-bottom: 1px solid var(--niche-border); }
.niche-single-meta a { color: var(--niche-text); font-weight: 500; }
.niche-single-meta a:hover { color: var(--niche-primary); }
.niche-single-meta svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; fill: none; margin-right: 0.375rem; vertical-align: -3px; }
.niche-single-thumbnail { margin: 2rem 0; border-radius: var(--niche-radius); overflow: hidden; }
.niche-single-thumbnail img { width: 100%; }
.niche-single-thumbnail figcaption { font-size: 0.875rem; color: var(--niche-text-light); margin-top: 0.75rem; text-align: center; font-style: italic; }

.niche-entry-content { font-size: 1.0625rem; line-height: 1.8; }
.niche-entry-content p { margin-bottom: 1.5em; }
.niche-entry-content h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.niche-entry-content h3 { font-size: 1.375rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.niche-entry-content a { color: var(--niche-primary); text-decoration: underline; text-decoration-color: rgba(99, 102, 241, 0.3); text-underline-offset: 2px; }
.niche-entry-content a:hover { text-decoration-color: var(--niche-primary); }
.niche-entry-content blockquote { margin: 2rem 0; padding: 1.5rem 2rem; border-left: 4px solid var(--niche-primary); background: var(--niche-bg-alt); border-radius: 0 var(--niche-radius) var(--niche-radius) 0; font-size: 1.125rem; font-style: italic; color: var(--niche-text); }
.niche-entry-content ul, .niche-entry-content ol { margin: 1.5em 0; padding-left: 1.5em; }
.niche-entry-content li { margin-bottom: 0.5em; }
.niche-entry-content img { margin: 2rem 0; border-radius: var(--niche-radius); }
.niche-entry-content pre { background: var(--niche-secondary); color: #e5e7eb; padding: 1.5rem; overflow-x: auto; font-size: 0.875rem; border-radius: var(--niche-radius); }
.niche-entry-content code { background: var(--niche-bg-alt); padding: 0.125rem 0.375rem; font-size: 0.875em; border-radius: 0.25rem; }
.niche-entry-content pre code { background: transparent; padding: 0; }
.niche-entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9375rem; overflow-x: auto; display: block; }
.niche-entry-content thead { background: var(--niche-bg-alt, #f4f4f4); }
.niche-entry-content th, .niche-entry-content td { padding: 0.75rem 1rem; border: 1px solid var(--niche-border, #ddd); text-align: left; vertical-align: top; }
.niche-entry-content th { font-weight: 700; white-space: nowrap; }
.niche-entry-content tr:nth-child(even) { background: var(--niche-bg-alt, #f8f8f8); }

.niche-tags { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--niche-border); }
.niche-tags-label { font-size: 0.875rem; font-weight: 600; margin-right: 0.75rem; color: var(--niche-text); }
.niche-tag { display: inline-block; padding: 0.375rem 0.75rem; background: var(--niche-bg-alt); color: var(--niche-text-light); font-size: 0.8125rem; border-radius: 9999px; margin: 0.25rem; }
.niche-tag:hover { background: var(--niche-primary); color: #fff; }

.niche-share { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; padding: 1.25rem; background: var(--niche-bg-alt); border-radius: var(--niche-radius); }
.niche-share-label { font-size: 0.875rem; font-weight: 600; color: var(--niche-text); }
.niche-share-link { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; background: var(--niche-bg); color: var(--niche-text-light); border-radius: 50%; transition: all var(--niche-transition); }
.niche-share-link:hover { background: var(--niche-primary); color: #fff; }
.niche-share-link svg { width: 1rem; height: 1rem; fill: currentColor; }

.niche-author-box { margin-top: 2rem; padding: 1.5rem; background: var(--niche-bg-alt); border-radius: var(--niche-radius); display: flex; gap: 1.25rem; }
.niche-author-avatar { flex-shrink: 0; }
.niche-author-avatar img { width: 80px; height: 80px; min-width: 80px; border-radius: 50%; object-fit: cover; display: block; }
.niche-author-info { flex: 1; }
.niche-author-name { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.25rem; }
.niche-author-name a { color: var(--niche-secondary); }
.niche-author-name a:hover { color: var(--niche-primary); }
.niche-author-bio { font-size: 0.9375rem; color: var(--niche-text-light); line-height: 1.6; }

.niche-post-nav { margin-top: 2.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.niche-post-nav-item { padding: 1.25rem; background: var(--niche-bg-alt); border-radius: var(--niche-radius); transition: all var(--niche-transition); }
.niche-post-nav-item:hover { background: var(--niche-bg); box-shadow: var(--niche-shadow); }
.niche-post-nav-next { text-align: right; }
.niche-post-nav-label { display: block; font-size: 0.8125rem; color: var(--niche-text-light); margin-bottom: 0.375rem; }
.niche-post-nav-title { font-size: 1rem; font-weight: 600; color: var(--niche-secondary); line-height: 1.4; }
.niche-post-nav-item:hover .niche-post-nav-title { color: var(--niche-primary); }

.niche-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--niche-border); }
.niche-related-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--niche-secondary); }
.niche-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.niche-related-item { background: var(--niche-bg); border: 1px solid var(--niche-border); border-radius: var(--niche-radius); overflow: hidden; transition: all var(--niche-transition); }
.niche-related-item:hover { box-shadow: var(--niche-shadow); border-color: transparent; }
.niche-related-thumb { overflow: hidden; }
.niche-related-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform 0.3s ease; }
.niche-related-item:hover .niche-related-thumb img { transform: scale(1.05); }
.niche-related-item-body { padding: 1rem; }
.niche-related-item-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--niche-secondary); }
.niche-related-item:hover .niche-related-item-title { color: var(--niche-primary); }

.niche-sidebar { font-size: 0.9375rem; }
.niche-widget { background: var(--niche-bg); border: 1px solid var(--niche-border); padding: 1.25rem; margin-bottom: 1.5rem; border-radius: var(--niche-radius); }
.niche-widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--niche-primary); color: var(--niche-secondary); }
.niche-widget ul { list-style: none; margin: 0; padding: 0; }
.niche-widget li { padding: 0.5rem 0; border-bottom: 1px solid var(--niche-border); }
.niche-widget li:last-child { border-bottom: none; }
.niche-widget a { color: var(--niche-text); }
.niche-widget a:hover { color: var(--niche-primary); }

.niche-pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--niche-border); }
.niche-pagination a, .niche-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem; font-weight: 500; font-size: 0.9375rem; border-radius: var(--niche-radius); border: 1px solid var(--niche-border); }
.niche-pagination a:hover { border-color: var(--niche-primary); color: var(--niche-primary); }
.niche-pagination .current { background: var(--niche-primary); color: #fff; border-color: var(--niche-primary); }

.niche-archive-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--niche-border); }
.niche-archive-title { font-size: 2rem; margin-bottom: 0.5rem; }
.niche-archive-description { color: var(--niche-text-light); font-size: 1rem; }

.niche-search-header { margin-bottom: 2rem; padding: 1.5rem; background: var(--niche-bg-alt); border-radius: var(--niche-radius); }
.niche-search-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.niche-search-title span { color: var(--niche-primary); }
.niche-search-count { color: var(--niche-text-light); font-size: 0.9375rem; }
.niche-no-posts { text-align: center; padding: 3rem 2rem; background: var(--niche-bg-alt); border-radius: var(--niche-radius); }
.niche-no-posts h2 { font-size: 1.375rem; margin-bottom: 0.75rem; }
.niche-no-posts p { color: var(--niche-text-light); margin-bottom: 1.5rem; }
.niche-search-form-inline { display: flex; max-width: 400px; margin: 0 auto; }
.niche-search-form-inline .niche-search-input { flex: 1; padding: 0.75rem 1rem; border: 1px solid var(--niche-border); border-right: none; border-radius: var(--niche-radius) 0 0 var(--niche-radius); font-size: 1rem; }
.niche-search-form-inline .niche-search-input:focus { border-color: var(--niche-primary); outline: none; }
.niche-search-form-inline .niche-search-submit { padding: 0.75rem 1.25rem; background: var(--niche-primary); color: #fff; border: none; border-radius: 0 var(--niche-radius) var(--niche-radius) 0; font-weight: 600; cursor: pointer; }
.niche-search-form-inline .niche-search-submit:hover { background: var(--niche-secondary); }

.niche-404 { text-align: center; padding: 4rem 2rem; }
.niche-404-code { font-size: 8rem; font-weight: 800; background: linear-gradient(135deg, var(--niche-primary), var(--niche-accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; margin-bottom: 1rem; }
.niche-404-title { font-size: 1.75rem; margin-bottom: 1rem; }
.niche-404-message { color: var(--niche-text-light); font-size: 1.0625rem; margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }
.niche-404-home { display: inline-block; padding: 0.875rem 2rem; background: var(--niche-primary); color: #fff; font-weight: 600; border-radius: var(--niche-radius); margin-top: 1rem; }
.niche-404-home:hover { background: var(--niche-secondary); color: #fff; }

.niche-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--niche-border); }
.niche-comments-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--niche-secondary); }
.niche-comments-list { list-style: none; margin: 0; padding: 0; }
.niche-comment { padding: 1.25rem 0; border-bottom: 1px solid var(--niche-border); }
.niche-comment:last-child { border-bottom: none; }
.niche-comment-body { display: flex; gap: 1rem; }
.niche-comment-avatar img { width: 48px; height: 48px; border-radius: 50%; }
.niche-comment-content { flex: 1; }
.niche-comment-meta { margin-bottom: 0.5rem; }
.niche-comment-author { font-weight: 600; font-size: 0.9375rem; color: var(--niche-secondary); }
.niche-comment-date { font-size: 0.8125rem; color: var(--niche-text-light); margin-left: 0.75rem; }
.niche-comment-text { font-size: 0.9375rem; line-height: 1.6; }
.niche-comment-actions { margin-top: 0.5rem; font-size: 0.8125rem; }
.niche-comment-actions a { color: var(--niche-text-light); margin-right: 1rem; }
.niche-comment-actions a:hover { color: var(--niche-primary); }
.niche-comment-awaiting { background: #fef3c7; padding: 0.5rem 0.75rem; font-size: 0.8125rem; border-radius: var(--niche-radius); margin-bottom: 0.75rem; color: #92400e; }
.niche-comment-form { margin-top: 2rem; }
.niche-comment-form label { display: block; font-weight: 600; margin-bottom: 0.375rem; font-size: 0.875rem; color: var(--niche-text); }
.niche-comment-form input[type="text"], .niche-comment-form input[type="email"], .niche-comment-form input[type="url"], .niche-comment-form textarea { width: 100%; padding: 0.75rem 1rem; border: 1px solid var(--niche-border); font-size: 1rem; margin-bottom: 1rem; border-radius: var(--niche-radius); font-family: var(--niche-font-body); }
.niche-comment-form textarea { min-height: 150px; resize: vertical; }
.niche-comment-form input:focus, .niche-comment-form textarea:focus { border-color: var(--niche-primary); outline: none; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.niche-comment-form input[type="submit"] { background: var(--niche-primary); color: #fff; border: none; padding: 0.875rem 2rem; font-size: 1rem; font-weight: 600; cursor: pointer; border-radius: var(--niche-radius); }
.niche-comment-form input[type="submit"]:hover { background: var(--niche-secondary); }
.niche-comments-closed { background: var(--niche-bg-alt); padding: 1rem; text-align: center; color: var(--niche-text-light); font-size: 0.9375rem; border-radius: var(--niche-radius); }

.niche-footer { background: var(--niche-secondary); color: #fff; margin-top: 3rem; }
.niche-footer-widgets { padding: 3rem 0; }
.niche-footer-widgets-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.niche-footer-widget { font-size: 0.9375rem; }
.niche-footer-widget-title { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--niche-primary); color: #fff; }
.niche-footer-widget ul { list-style: none; margin: 0; padding: 0; }
.niche-footer-widget li { padding: 0.375rem 0; }
.niche-footer-widget a { color: rgba(255,255,255,0.7); }
.niche-footer-widget a:hover { color: #fff; }
.niche-footer-nav { padding: 1.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); }
.niche-footer-menu { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.niche-footer-menu a { color: rgba(255,255,255,0.7); font-size: 0.875rem; font-weight: 500; }
.niche-footer-menu a:hover { color: #fff; }
.niche-footer-bottom { padding: 1.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; }
.niche-copyright { font-size: 0.875rem; color: rgba(255,255,255,0.5); }

.niche-scroll-top { position: fixed; bottom: 2rem; right: 2rem; width: 3rem; height: 3rem; background: var(--niche-primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all var(--niche-transition); z-index: 999; border-radius: 50%; box-shadow: var(--niche-shadow-lg); }
.niche-scroll-top.niche-scroll-top-visible { opacity: 1; visibility: visible; }
.niche-scroll-top:hover { background: var(--niche-secondary); transform: translateY(-3px); }
.niche-scroll-top svg { width: 1.25rem; height: 1.25rem; stroke: currentColor; fill: none; }

@media (max-width: 1024px) {
    .niche-layout.right-sidebar, .niche-layout.left-sidebar { grid-template-columns: 1fr; }
    .niche-layout.left-sidebar .niche-sidebar { order: 0; }
    .niche-sidebar { order: 2; }
    .niche-footer-widgets-grid, .niche-footer-widgets-grid.niche-footer-cols-3, .niche-footer-widgets-grid.niche-footer-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .niche-related-grid { grid-template-columns: repeat(2, 1fr); }
    .niche-featured-article .niche-article-card { flex-direction: column; }
    .niche-featured-article .niche-article-thumb { flex: none; }
    .niche-featured-article .niche-article-thumb img { min-height: auto; }
}

@media (max-width: 768px) {
    .niche-nav-menu { display: none; position: fixed; top: 4rem; left: 0; right: 0; background: var(--niche-bg); flex-direction: column; padding: 1rem; box-shadow: var(--niche-shadow-lg); border-top: 1px solid var(--niche-border); z-index: 1001; }
    .niche-nav-menu.niche-nav-open { display: flex; }
    .niche-nav-menu a { padding: 0.75rem 1rem; border-radius: var(--niche-radius); }
    .niche-menu-toggle { display: block; }
    .niche-menu-close-item { display: flex; justify-content: flex-end; list-style: none; padding: 0 0 0.5rem; margin: 0 0 0.5rem; border-bottom: 1px solid var(--niche-border); }
    .niche-articles-grid, .niche-articles-grid.grid-3col, .niche-articles-grid.grid-2col { grid-template-columns: 1fr; }
    .niche-single-title { font-size: 1.75rem; }
    .niche-footer-widgets-grid { grid-template-columns: 1fr; }
    .niche-related-grid { grid-template-columns: 1fr; }
    .niche-post-nav { grid-template-columns: 1fr; gap: 1rem; }
    .niche-post-nav-next { text-align: left; }
    .niche-author-box { flex-direction: column; text-align: center; }
    .niche-share { flex-wrap: wrap; justify-content: center; }
    .niche-single-meta { gap: 1rem; }
    .niche-sidebar { display: none !important; }
    .niche-logo img, .niche-logo .custom-logo { max-height: 40px; }
    .niche-footer-widgets-grid, .niche-footer-widgets-grid.niche-footer-cols-2, .niche-footer-widgets-grid.niche-footer-cols-3, .niche-footer-widgets-grid.niche-footer-cols-4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    html { font-size: 15px; }
    .niche-container { padding: 0 1rem; }
    .niche-single-title { font-size: 1.5rem; }
    .niche-404-code { font-size: 5rem; }
    .niche-footer-menu { flex-direction: column; align-items: center; gap: 0.75rem; }
}

:focus { outline: 2px solid var(--niche-primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--niche-primary); outline-offset: 2px; }

/* Interlinking Section */
.niche-interlinking {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--niche-bg-alt);
    border-radius: var(--niche-radius);
}
.niche-interlinking-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--niche-secondary);
}
.niche-interlinking-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.niche-interlinking-list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}
.niche-interlinking-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--niche-primary);
}
.niche-interlinking-list a {
    color: var(--niche-primary);
    text-decoration: none;
}
.niche-interlinking-list a:hover {
    text-decoration: underline;
}

/* Footer columns */
.niche-footer-widgets-grid.niche-footer-cols-2 { grid-template-columns: repeat(2, 1fr); }
.niche-footer-widgets-grid.niche-footer-cols-3 { grid-template-columns: repeat(3, 1fr); }
.niche-footer-widgets-grid.niche-footer-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Footer description */
.niche-footer-description { display: block; margin-top: 0.375rem; font-size: 0.8125rem; color: rgba(255,255,255,0.4); }

/* Responsive embeds */
.niche-entry-content iframe,
.niche-entry-content embed,
.niche-entry-content object,
.niche-entry-content video { max-width: 100%; }
.niche-entry-content .wp-block-embed { margin: 1.5em 0; }

/* Print styles */
@media print {
    .niche-header, .niche-footer, .niche-sidebar, .niche-scroll-top, .niche-breadcrumbs,
    .niche-related, .niche-interlinking, .niche-post-nav, .niche-comments, .niche-share,
    .niche-search-overlay, .niche-menu-toggle, .niche-search-toggle { display: none !important; }
    body { color: #000; background: #fff; font-size: 12pt; }
    a { color: #000; text-decoration: underline; }
    .niche-container { max-width: 100%; padding: 0; }
    .niche-layout { display: block; }
}

/* ==========================================================================
   Structural Diversification
   ========================================================================== */

body.niche-card-horizontal .niche-articles-grid { grid-template-columns: 1fr; }
body.niche-card-horizontal .niche-article-card { display: flex; flex-direction: row; }
body.niche-card-horizontal .niche-article-thumb { width: 40%; flex-shrink: 0; aspect-ratio: auto; }
body.niche-card-horizontal .niche-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
body.niche-card-horizontal .niche-article-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 768px) {
    body.niche-card-horizontal .niche-article-card { flex-direction: column; }
    body.niche-card-horizontal .niche-article-thumb { width: 100%; }
}

body.niche-card-overlay .niche-article-card { position: relative; min-height: 280px; overflow: hidden; }
body.niche-card-overlay .niche-article-thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto; }
body.niche-card-overlay .niche-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
body.niche-card-overlay .niche-article-body {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; justify-content: flex-end;
    min-height: 280px; padding: 1.25rem;
    background: linear-gradient(transparent 30%, rgba(0,0,0,0.85) 100%);
}
body.niche-card-overlay .niche-article-title a,
body.niche-card-overlay .niche-article-meta,
body.niche-card-overlay .niche-article-excerpt { color: #fff; }

body.niche-card-text .niche-article-thumb { display: none; }
body.niche-card-text .niche-article-card { border-left: 3px solid var(--niche-primary, #6366f1); padding-left: 1rem; }

body.niche-header-centered .niche-header-inner { flex-direction: column; align-items: center; gap: 0.5rem; }
body.niche-header-centered .niche-nav { order: 2; }
@media (max-width: 768px) { body.niche-header-centered .niche-header-inner { flex-direction: row; } }

body.niche-header-stacked .niche-header-inner { flex-wrap: wrap; gap: 0; }
body.niche-header-stacked .niche-logo { width: 100%; text-align: center; padding: 0.5rem 0; }
body.niche-header-stacked .niche-nav { flex: 1; justify-content: center; }
@media (max-width: 768px) { body.niche-header-stacked .niche-logo { width: auto; text-align: left; padding: 0; } }

body.niche-featured-hero .niche-featured-article .niche-article-card { min-height: 400px; }
body.niche-featured-hero .niche-featured-article .niche-article-title { font-size: 2rem; }
body.niche-featured-none .niche-featured-article { display: none; }

body.niche-hover-shadow .niche-article-card:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
body.niche-hover-glow .niche-article-card:hover { box-shadow: 0 0 20px rgba(0,0,0,0.12); }
body.niche-hover-border .niche-article-card:hover { border-color: var(--niche-primary, #6366f1); transform: none; box-shadow: none; }
body.niche-hover-none .niche-article-card:hover { transform: none; box-shadow: none; }
