/* Base Container */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

/* Header */
.site-header.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-color);
    z-index: 100;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.site-main {
    margin-top: calc(var(--header-height) + 40px);
    padding-bottom: 80px;
}

/* Archive Header Toolbar */
.archive-header {
    margin-bottom: 40px;
}
.page-title {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 24px;
}
.archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
}
.category-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar {
    display: none;
}
.category-scroll a {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}
.category-scroll a:hover, .category-scroll a.active {
    color: var(--text-primary);
}
.toolbar-actions {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}
.toolbar-actions button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Grid Layout */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5rem 1.5rem; /* 80px vertical, 24px horizontal */
}
@media (min-width: 640px) {
    .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .article-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Article Card */
.article-card {
    position: relative;
}
.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    margin-bottom: 16px;
}
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}
.article-card:hover .card-image {
    transform: scale(1.025);
}
.card-content {
    padding-top: 8px;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0 0 12px 0;
}
.card-meta {
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}
.card-cat {
    color: var(--text-primary);
}
.card-date {
    color: var(--text-muted);
}

/* Pagination */
.nav-links {
    display: flex;
    gap: 8px;
    margin-top: 60px;
    justify-content: center;
}
.nav-links a, .nav-links span {
    padding: 8px 16px;
    border-radius: 4px;
    background: var(--bg-tertiary);
}
.nav-links .current {
    background: var(--accent-color);
    color: var(--bg-color);
}

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

/* Reading Width Container */
.container-reading {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Single Article Header */
.article-header {
    margin-top: 60px;
    margin-bottom: 40px;
}
.article-meta-top {
    display: flex;
    gap: 16px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 24px;
}
.article-category {
    color: var(--accent-color);
}
.article-date {
    color: var(--text-muted);
}
.article-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.1;
    margin: 0 0 24px 0;
    letter-spacing: -0.02em;
}
.article-dek {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}
.article-author {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.author-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Single Article Image */
.article-featured-image {
    margin-bottom: 60px;
}
.featured-img {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-radius: 12px;
}

/* Single Article Body Content */
.article-content {
    font-size: 1.125rem; /* 18px */
    line-height: 1.7;
    color: #e5e5e5;
}
.article-content p {
    margin-bottom: 1.75em;
}
.article-content h2, .article-content h3, .article-content h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 2em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}
.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s;
}
.article-content a:hover {
    text-decoration-color: var(--text-primary);
}
.article-content blockquote {
    margin: 2em 0;
    padding-left: 24px;
    border-left: 4px solid var(--text-muted);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-primary);
}
.article-content ul, .article-content ol {
    margin-bottom: 1.75em;
    padding-left: 1.5em;
}
.article-content li {
    margin-bottom: 0.5em;
}

/* Related Posts */
.related-posts {
    margin-top: 100px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 60px;
}
.related-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 32px;
}

/* =========================================
   Single Tool Styles
   ========================================= */
.tool-header-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 640px) {
    .tool-header-grid {
        flex-direction: row;
        align-items: flex-start;
    }
}
.tool-logo-col {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.1);
}
@media (min-width: 640px) {
    .tool-logo-col {
        width: 160px;
        height: 160px;
    }
}
.tool-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tool-info-col {
    flex: 1;
}
.tool-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.tool-meta-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.tool-meta-item {
    font-size: 1rem;
}
.meta-label {
    color: var(--text-muted);
    font-weight: 500;
}
.meta-value {
    color: var(--text-primary);
    font-weight: 500;
}
.tool-cta-btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, background-color 0.2s;
}
.tool-cta-btn:hover {
    transform: scale(1.02);
    background-color: #e5e5e5;
}

/* =========================================
   AJAX Sort UI & Accessibility
   ========================================= */
.sort-dropdown {
    position: relative;
}
.sort-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
}
.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-direction: column;
    min-width: 140px;
    z-index: 50;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.sort-menu.active {
    display: flex;
}
.sort-link {
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-radius: 4px;
}
.sort-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}
.sort-link.active {
    color: var(--accent-color);
    font-weight: 600;
}
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.article-grid {
    transition: opacity 0.2s ease;
}

/* =========================================
   Logo Styles
   ========================================= */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-image .custom-logo-img {
    height: 48px !important;
    width: auto !important;
    max-width: none !important;
    display: block;
}

@media (min-width: 640px) {
    .logo-image .custom-logo-img {
        height: 60px !important;
    }
}

/* =========================================
   Sitemap & Pages
   ========================================= */
.sitemap-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
}
@media (min-width: 768px) {
    .sitemap-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
.sitemap-col h2 {
    font-size: 1.25rem;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}
.sitemap-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sitemap-col li {
    margin-bottom: 12px;
}
.sitemap-col a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}
.sitemap-col a:hover {
    color: var(--text-primary);
}

/* =========================================
   Primary Header Navigation
   ========================================= */
.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 32px;
    align-items: center;
}
.main-navigation li {
    margin: 0;
}
.main-navigation a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--text-primary);
}
/* Ensure the search icon on the right isn't pushed too far */
.header-actions {
    display: flex;
    align-items: center;
}

/* =========================================
   Page & Article Typography
   ========================================= */
.page-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.page-content p {
    margin-bottom: 20px;
    line-height: 1.7;
    color: var(--text-muted);
}
.page-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.page-content a:hover {
    color: var(--text-primary);
}
.page-content hr {
    border: 0;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 40px 0;
}

/* =========================================
   Header Search
   ========================================= */
.header-search-form {
    margin: 0;
}
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-input-wrapper .search-field {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 8px 16px 8px 36px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-family: inherit;
    width: 200px;
    transition: all 0.2s ease;
    outline: none;
}
.search-input-wrapper .search-field:focus {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    width: 240px;
}
.search-input-wrapper .search-field::placeholder {
    color: var(--text-muted);
}
