/* Authority Starter — Main Stylesheet */
/* Loaded deferred (non-critical, below-the-fold styles) */

/* ==========================================================================
   Layout
   ========================================================================== */

.layout-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.layout-full {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

@media (max-width: 960px) {
    .layout-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.03em; }
h2 { font-size: 1.75rem; letter-spacing: -0.02em; margin-top: 2.5rem; }
h3 { font-size: 1.375rem; margin-top: 2rem; }
h4 { font-size: 1.125rem; margin-top: 1.5rem; }

p { margin-bottom: 1.25rem; }

blockquote {
    border-left: 4px solid var(--color-accent);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--color-bg-alt);
    font-style: italic;
    color: var(--color-text-light);
}

ul, ol { margin: 0 0 1.25rem 1.5rem; }
li { margin-bottom: 0.375rem; }

/* ==========================================================================
   Homepage — Hero Section
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero-section h1 {
    color: #fff;
    font-size: 2.75rem;
    margin-bottom: 1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 3.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-search button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-accent);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.125rem;
}

/* ==========================================================================
   Silo Grid (Homepage)
   ========================================================================== */

.silo-section {
    padding: 3rem 0;
}

.section-heading {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subheading {
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

.silo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.silo-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.silo-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.silo-card-icon {
    width: 48px;
    height: 48px;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--color-accent);
}

.silo-card h3 {
    font-size: 1.125rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.silo-card h3 a { color: var(--color-primary); }
.silo-card h3 a:hover { color: var(--color-accent); }

.silo-card-desc {
    font-size: 0.875rem;
    color: var(--color-text-light);
    flex-grow: 1;
    margin-bottom: 1rem;
}

.silo-card-count {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent);
}

/* ==========================================================================
   Latest Articles Grid
   ========================================================================== */

.latest-section {
    background: var(--color-bg-alt);
    padding: 3rem 0;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.post-card-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--color-bg-alt);
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-card-thumb img {
    transform: scale(1.03);
}

.post-card-body {
    padding: 1.25rem;
}

.post-card-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.post-card h3 {
    font-size: 1.0625rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.post-card h3 a { color: var(--color-primary); }
.post-card h3 a:hover { color: var(--color-accent); }

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.post-card-meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    display: flex;
    gap: 1rem;
}

.post-card-meta time { font-weight: 500; }

/* Featured post (first in grid) */
.post-card.is-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
}

.post-card.is-featured .post-card-body { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.post-card.is-featured h3 { font-size: 1.5rem; }

@media (max-width: 640px) {
    .post-card.is-featured { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Single Article
   ========================================================================== */

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    flex-wrap: wrap;
}

.article-meta-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-meta-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.article-category-badge {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

/* Article body content */
.article-content {
    max-width: 720px;
}

.article-content img {
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.article-content a {
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.3);
    text-underline-offset: 3px;
}

.article-content a:hover {
    text-decoration-color: var(--color-accent);
}

/* Table of Contents */
.toc-container {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-title::after {
    content: '\25B2';
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.toc-title.is-collapsed::after { transform: rotate(180deg); }

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.375rem;
}

.toc-list a {
    font-size: 0.875rem;
    color: var(--color-text-light);
    padding: 0.25rem 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    transition: color 0.2s, border-color 0.2s;
}

.toc-list a:hover,
.toc-list a.is-active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.toc-list .toc-h3 { padding-left: 1.5rem; font-size: 0.8125rem; }

/* ==========================================================================
   Sidebar
   ========================================================================== */

.site-sidebar {
    font-size: 0.9375rem;
}

.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.widget-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-accent);
}

/* Sticky sidebar ad */
.sidebar-sticky {
    position: sticky;
    top: 80px;
}

/* Related Posts in sidebar/below content */
.related-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.related-post-item:last-child { border-bottom: none; }

.related-post-thumb {
    width: 72px;
    height: 54px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-bg-alt);
}

.related-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.related-post-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-primary);
}

.related-post-title:hover { color: var(--color-accent); }

/* ==========================================================================
   Author Box
   ========================================================================== */

.author-box {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: 2rem;
}

.author-box-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.author-box-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.author-box-name a { color: inherit; }

.author-box-bio {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* ==========================================================================
   Archive / Silo Pages
   ========================================================================== */

.archive-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    padding: 2.5rem 0;
    margin-bottom: 0;
}

.archive-header h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.archive-header .archive-description {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    max-width: 600px;
}

.pillar-feature {
    background: var(--color-bg);
    border: 2px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.pillar-feature-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.pillar-feature h2 { margin-top: 0; font-size: 1.375rem; }

.pillar-feature h2 a { color: var(--color-primary); }
.pillar-feature h2 a:hover { color: var(--color-accent); }

/* ==========================================================================
   Ads
   ========================================================================== */

.ad-slot {
    text-align: center;
    overflow: hidden;
}

.ad-slot-content {
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.ad-slot-sidebar {
    margin-bottom: 1.5rem;
}

.ad-slot-footer {
    background: var(--color-bg-alt);
    padding: 1rem 0;
    border-top: 1px solid var(--color-border);
}

.ad-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   Internal Linking Sections
   ========================================================================== */

.silo-links-section {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
}

.silo-links-section h3 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.silo-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.silo-links-list a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.silo-links-list a:hover { background: var(--color-bg); }

.cross-silo-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--color-primary);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
}

.footer-silos {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-site-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
}

.footer-silo-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-silo-link {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-silo-link:hover { color: #fff; }

.footer-navigation {
    margin-bottom: 1.5rem;
}

.footer-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-menu a {
    color: rgba(255,255,255,0.6);
    font-size: 0.8125rem;
}

.footer-menu a:hover { color: #fff; }

.footer-bottom {
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.4);
}

@media (max-width: 768px) {
    .footer-silos {
        grid-template-columns: 1fr 1fr;
    }
    .hero-section h1 { font-size: 2rem; }
    .hero-section { padding: 2.5rem 0; }
    .article-header h1 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .footer-silos { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Search / 404
   ========================================================================== */

.search-form {
    display: flex;
    max-width: 500px;
    margin: 1.5rem 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 1rem;
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    font-weight: 600;
}

.search-form button:hover { background: var(--color-accent-hover); }

.page-404-content {
    text-align: center;
    padding: 4rem 0;
}

.page-404-content h1 {
    font-size: 4rem;
    color: var(--color-accent);
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-border);
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-body {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.comment-metadata { font-size: 0.8125rem; color: var(--color-text-light); margin-bottom: 0.75rem; }

.comment-respond {
    margin-top: 2rem;
}

.comment-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.875rem; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.comment-form .submit {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    width: auto;
}

.comment-form .submit:hover { background: var(--color-accent-hover); }

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    transition: all 0.2s;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* ==========================================================================
   Utility
   ========================================================================== */

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
