/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red: #dc143c;
    --dark-red: #8b0000;
    --black: #0a0a0a;
    --gray: #1a1a1a;
    --light-gray: #2a2a2a;
    --text: #e0e0e0;
    --text-dim: #888;
    --green: #00ff88;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--black);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    background: var(--gray);
    border-bottom: 2px solid var(--red);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}


.logo-text {
    color: var(--red);
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--red);
}

/* Hero Section */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    color: var(--red);
    margin-bottom: 1rem;
    transition: transform 0.3s, text-shadow 0.3s;
}

.hero-title:hover {
    transform: scale(1.05);
    text-shadow: 0 0 20px var(--red);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.filter-btn {
    background: var(--light-gray);
    color: var(--text);
    border: 2px solid transparent;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.filter-btn.active {
    background: var(--red);
    color: white;
}

/* Posts Grid */
.posts-grid {
    padding: 3rem 0;
}

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

/* Post Cards */
.post-card {
    background: var(--gray);
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
}

.post-card:hover {
    border-color: var(--red);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.2);
}

.card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.category-badge {
    background: var(--dark-red);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.card-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
}

.card-title a:hover {
    color: var(--red);
}

.card-excerpt {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--green);
    margin-bottom: 1rem;
}

.read-more {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s;
    display: inline-block;
}

.read-more:hover {
    transform: translateX(5px);
}

/* Single Post */
.post-single {
    padding: 3rem 0;
}

.post-header {
    margin-bottom: 3rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.post-meta .category {
    background: var(--red);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
}

.post-meta .date,
.post-meta .reading-time {
    color: var(--green);
}

.post-title {
    font-size: 2.5rem;
    color: var(--red);
    line-height: 1.2;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    color: var(--red);
    margin: 2rem 0 1rem;
}

.post-content h3 {
    color: var(--text);
    margin: 1.5rem 0 0.8rem;
}

.post-content p {
    margin-bottom: 1.2rem;
}

.post-content code {
    background: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: var(--green);
}

.post-content pre {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.post-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--light-gray);
}

.tag {
    display: inline-block;
    background: var(--light-gray);
    color: var(--text);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.tag:hover {
    background: var(--red);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .main-nav {
        gap: 1rem;
    }
}

/* Footer */
.site-footer {
    background: var(--black);
    border-top: 1px solid var(--light-gray);
    padding: 2.5rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 3rem;
    max-width: 900px;
}

.footer-section h3.footer-title {
    color: var(--text);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-section h4.footer-heading {
    color: var(--text);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--red);
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 2rem 0;
}

.pagination-link {
    background: var(--light-gray);
    color: var(--text);
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.pagination-link:hover {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-number {
    background: var(--light-gray);
    color: var(--text);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
    min-width: 45px;
    text-align: center;
}

.pagination-number:hover {
    border-color: var(--red);
    color: var(--red);
}

.pagination-number.active {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Search Page */
.search-section {
    padding: 3rem 0;
    min-height: 70vh;
}

.search-title {
    font-size: 2.5rem;
    color: var(--red);
    margin-bottom: 0.5rem;
    text-align: center;
}

.search-subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

.search-box {
    position: relative;
    margin-bottom: 3rem;
}

#search-input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    font-size: 1.1rem;
    background: var(--gray);
    border: 2px solid var(--light-gray);
    border-radius: 50px;
    color: var(--text);
    transition: all 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.search-stat {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.no-results {
    text-align: center;
    color: var(--text-dim);
    font-size: 1.1rem;
    padding: 3rem 0;
}

/* Search Result Cards */
.search-result-card {
    background: var(--gray);
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
}

.search-result-card:hover {
    border-color: var(--red);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(220, 20, 60, 0.15);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.result-category {
    background: var(--dark-red);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.result-date {
    color: var(--green);
    font-size: 0.85rem;
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.result-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s;
}

.result-title a:hover {
    color: var(--red);
}

.result-excerpt {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.result-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-tag {
    color: var(--red);
    font-size: 0.85rem;
}

/* Tags Page */
.tags-section {
    padding: 3rem 0;
    min-height: 60vh;
}

.tags-title {
    font-size: 2.5rem;
    color: var(--red);
    margin-bottom: 0.5rem;
    text-align: center;
}

.tags-subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 3rem;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.tag-item {
    background: var(--gray);
    border: 2px solid var(--light-gray);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.tag-item:hover {
    border-color: var(--red);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.2);
}

.tag-name {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

.tag-count {
    background: var(--red);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Taxonomy Page (Individual Tag) */
.taxonomy-section {
    padding: 3rem 0;
}

.taxonomy-header {
    text-align: center;
    margin-bottom: 3rem;
}

.taxonomy-title {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.tag-symbol {
    color: var(--red);
}

.taxonomy-count {
    color: var(--text-dim);
    font-size: 1rem;
}

.no-tags {
    text-align: center;
    color: var(--text-dim);
    padding: 3rem 0;
    font-size: 1.1rem;
}

/* Individual Tag Page */
.taxonomy-section {
    padding: 3rem 0;
}

.taxonomy-header {
    text-align: center;
    margin-bottom: 3rem;
}

.taxonomy-title {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.tag-symbol {
    color: var(--red);
}

.taxonomy-count {
    color: var(--text-dim);
    font-size: 1rem;
}

.back-to-tags {
    text-align: center;
    margin-top: 3rem;
}

.back-link {
    color: var(--text);
    text-decoration: none;
    padding: 0.8rem 2rem;
    background: var(--gray);
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    display: inline-block;
    transition: all 0.3s;
    font-weight: 600;
}

.back-link:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ========== MOBILE RESPONSIVE FIXES ========== */

/* Mobile: Max width 768px */
@media (max-width: 768px) {
    /* Container padding for mobile */
    .container {
        padding: 0 1rem;
    }
    
    .container-narrow {
        padding: 0 1rem;
    }
    
    /* Header/Navigation */
    .nav-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-icon-img {
        width: 30px;
        height: 30px;
    }
    
    .main-nav {
        flex-wrap: wrap;
        gap: 0.8rem;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0 1.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }
    
    /* Category Filters */
    .category-filters {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Posts Grid - Single Column on Mobile */
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Post Cards */
    .post-card {
        padding: 1.2rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-excerpt {
        font-size: 0.9rem;
    }
    
    .card-meta {
        flex-direction: column;
        gap: 0.3rem;
        font-size: 0.8rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-section {
        text-align: center;
    }
    
    /* Search Page */
    .search-title {
        font-size: 1.8rem;
    }
    
    #search-input {
        font-size: 1rem;
        padding: 0.9rem 1rem 0.9rem 2.8rem;
    }
    
    .search-icon {
        left: 1rem;
        font-size: 1rem;
    }
    
    /* Tags Page */
    .tags-title {
        font-size: 1.8rem;
    }
    
    .tags-cloud {
        gap: 0.6rem;
        padding: 0 0.5rem;
    }
    
    .tag-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Single Post Page */
    .post-title {
        font-size: 1.8rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.4rem;
    }
    
    .post-content h3 {
        font-size: 1.2rem;
    }
    
    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
    }
    
    .pagination-number {
        min-width: 40px;
        padding: 0.6rem 0.8rem;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .category-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .post-card {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}
