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

body {
    background: #000;
    color: #c0c0c0;
    font-family: 'Times New Roman', serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Header & Navigation
   =================================== */
.header {
    background: linear-gradient(to bottom, #1a1a1a 0%, #000 100%);
    padding: 25px 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo h1 {
    font-size: 42px;
    color: #ff0000;
    text-shadow: 2px 2px 4px #000, 0 0 10px #8b0000;
    font-weight: bold;
    letter-spacing: 3px;
    font-family: 'Georgia', serif;
    margin-bottom: 8px;
}

.logo p {
    color: #808080;
    font-size: 13px;
    font-style: italic;
}

.nav {
    background: transparent;
}

.nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav li {
    /* Remove borders */
}

.nav a {
    display: block;
    padding: 14px 24px;
    color: #c0c0c0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.nav a:hover {
    background: #8b0000;
    color: #fff;
}

/* ===================================
   Main Layout
   =================================== */
.container {
    max-width: 1200px;
    margin: 35px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 25px;
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
    background: #0d0d0d;
    padding: 18px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h3 {
    color: #ff0000;
    font-size: 15px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: bold;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    margin-bottom: 10px;
    padding-left: 15px;
    position: relative;
    line-height: 1.5;
}

.sidebar-section li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: #8b0000;
    font-size: 10px;
}

.sidebar-section a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 14px;
}

.sidebar-section a:hover {
    color: #ff0000;
}

/* ===================================
   Main Content Area
   =================================== */
.main-content {
    background: #0d0d0d;
    padding: 25px;
    min-height: 500px;
}

.search-box {
    background: #1a1a1a;
    padding: 22px;
    margin-bottom: 28px;
    border-radius: 5px;
}

.search-box h2 {
    color: #ff0000;
    font-size: 19px;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-form input,
.search-form textarea,
.search-form select,
.search-form button {
    width: 100%;
    padding: 11px;
    background: #000;
    color: #c0c0c0;
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    margin-bottom: 11px;
}

.search-form button {
    padding: 13px 30px;
    background: #8b0000;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s ease;
    white-space: nowrap;
    font-weight: bold;
}

.search-form button:hover {
    background: #a00000;
}

.content-section {
    margin-bottom: 35px;
}

.content-section h2 {
    color: #ff0000;
    font-size: 19px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: bold;
}

/* ===================================
   Blog Post Styles
   =================================== */
.post-item {
    background: #1a1a1a;
    padding: 28px;
    margin-bottom: 28px;
    transition: border-color 0.3s ease;
}

.post-item h3 {
    color: #ff0000;
    margin-bottom: 14px;
    font-size: 23px;
    line-height: 1.3;
}

.post-item h3 a {
    color: #ff0000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item h3 a:hover {
    color: #ff3333;
}

.post-meta {
    margin-bottom: 16px;
    font-size: 13px;
    color: #666;
}

.post-meta .date {
    color: #999;
}

.post-meta .category {
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
}

.post-meta .category:hover {
    color: #ff0000;
}

.post-excerpt {
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 12px;
    font-size: 15px;
}

.post-excerpt img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 18px 0;
    border-radius: 3px;
}

/* Excerpt Clamping */
.post-excerpt {
    position: relative;
    max-height: 14.4em; /* 1.8em * 8 lines */
    overflow: hidden;
}

.post-excerpt.expanded {
    max-height: none;
}

.read-more-btn {
    display: inline-block;
    margin-top: 8px;
    color: #ff0000;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.read-more-btn:hover {
    color: #ff3333;
    text-decoration: underline;
}

/* ===================================
   Markdown Content Styles
   =================================== */
.post-excerpt h1,
.post-excerpt h2,
.post-excerpt h3,
.post-excerpt h4,
.post-excerpt h5,
.post-excerpt h6 {
    color: #ff0000;
    margin-top: 24px;
    margin-bottom: 12px;
    line-height: 1.3;
}

.post-excerpt h1 { font-size: 28px; padding-bottom: 8px; }
.post-excerpt h2 { font-size: 24px; padding-bottom: 6px; }
.post-excerpt h3 { font-size: 20px; }
.post-excerpt h4 { font-size: 18px; }
.post-excerpt h5 { font-size: 16px; }
.post-excerpt h6 { font-size: 14px; }

.post-excerpt p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.post-excerpt ul,
.post-excerpt ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.post-excerpt li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.post-excerpt ul li {
    list-style-type: disc;
}

.post-excerpt ol li {
    list-style-type: decimal;
}

.post-excerpt blockquote {
    padding-left: 16px;
    margin: 20px 0;
    color: #999;
    font-style: italic;
}

.post-excerpt code {
    background: #222;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #ff6b6b;
}

.post-excerpt pre {
    background: #111;
    padding: 16px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-excerpt pre code {
    background: none;
    padding: 0;
    color: #c0c0c0;
    font-size: 14px;
}

.post-excerpt table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.post-excerpt th,
.post-excerpt td {
    padding: 10px 12px;
    text-align: left;
}

.post-excerpt th {
    background: #222;
    color: #ff0000;
    font-weight: bold;
}

.post-excerpt tr:nth-child(even) {
    background: #151515;
}

.post-excerpt a {
    color: #ff0000;
    text-decoration: none;
}

.post-excerpt a:hover {
    color: #ff3333;
    text-decoration: underline;
}

.post-excerpt hr {
    border: none;
    margin: 24px 0;
}

/* ===================================
   Archive List Styles
   =================================== */
.archive-list-item {
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.archive-list-item:hover {
    background: #111;
    padding-left: 10px;
    padding-right: 10px;
}

.archive-main {
    flex: 1;
}

.archive-title {
    font-size: 18px;
    color: #ff0000;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.archive-title:hover {
    color: #ff3333;
}

.archive-meta {
    font-size: 12px;
    color: #666;
}

.archive-meta span {
    margin-right: 16px;
}

.archive-meta .category {
    color: #999;
}

/* ===================================
   Stats & Footer
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.stat-box {
    background: #1a1a1a;
    padding: 18px;
    text-align: center;
}

.stat-box .number {
    font-size: 30px;
    color: #ff0000;
    font-weight: bold;
}

.stat-box .label {
    color: #808080;
    font-size: 13px;
    margin-top: 6px;
}

.sidebar-stats .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.sidebar-stats .label {
    color: #888;
    font-size: 14px;
}

.sidebar-stats .number {
    color: #ff0000;
    font-weight: bold;
    font-size: 15px;
}

.footer {
    background: #0d0d0d;
    padding: 22px 0;
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 35px;
}

.footer a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #ff0000;
}

/* ===================================
   Mobile Responsive Design
   =================================== */
@media screen and (max-width: 768px) {
    /* Global adjustments */
    body {
        font-size: 15px;
    }

    /* Header */
    .header {
        padding: 20px 0;
    }

    .header-content {
        padding: 0 15px;
    }

    .logo h1 {
        font-size: 32px;
        letter-spacing: 2px;
        margin-bottom: 10px;
    }

    .logo p {
        font-size: 12px;
    }

    /* Navigation */
    .nav ul {
        flex-direction: column;
        text-align: center;
    }

    .nav li {
        width: 100%;
    }

    .nav a {
        padding: 12px 0;
        font-size: 16px;
    }

    /* Container & Layout */
    .container {
        display: flex;
        flex-direction: column-reverse;
        gap: 20px;
        margin: 20px auto;
        padding: 0 15px;
    }

    .sidebar {
        width: 100%;
        padding: 16px;
    }

    .sidebar-section {
        margin-bottom: 24px;
    }

    .sidebar-section h3 {
        font-size: 15px;
    }

    .sidebar-section a {
        font-size: 15px;
    }

    /* Main content */
    .main-content {
        padding: 20px;
    }

    .content-section h2 {
        font-size: 17px;
    }

    /* Posts */
    .post-item {
        padding: 20px;
        margin-bottom: 20px;
    }

    .post-item h3 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .post-meta {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .post-excerpt {
        font-size: 15px;
        line-height: 1.8;
    }

    /* Markdown in mobile */
    .post-excerpt h1 { font-size: 24px; }
    .post-excerpt h2 { font-size: 20px; }
    .post-excerpt h3 { font-size: 18px; }
    .post-excerpt h4 { font-size: 16px; }

    .post-excerpt ul,
    .post-excerpt ol {
        padding-left: 20px;
    }

    .post-excerpt pre {
        padding: 12px;
        font-size: 13px;
        overflow-x: auto;
    }

    .post-excerpt table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
    }

    .post-excerpt th,
    .post-excerpt td {
        padding: 8px 10px;
    }

    /* Archive */
    .archive-list-item {
        padding: 14px 0;
    }

    .archive-title {
        font-size: 17px;
    }

    /* Forms */
    .search-box {
        padding: 18px;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input,
    .search-form textarea,
    .search-form button {
        width: 100%;
        margin-bottom: 10px;
        font-size: 16px;
    }

    /* Footer */
    .footer {
        padding: 20px 0;
        margin-top: 30px;
        font-size: 12px;
    }

    /* Stats */
    .stat-box {
        padding: 16px;
    }

    .stat-box .number {
        font-size: 26px;
    }

    .stat-box .label {
        font-size: 12px;
    }
}

/* ===================================
   Small Mobile Devices (≤ 480px)
   =================================== */
@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 26px;
        letter-spacing: 1px;
    }

    .post-item {
        padding: 16px;
    }

    .post-item h3 {
        font-size: 18px;
    }

    .post-excerpt {
        font-size: 14px;
    }

    .main-content {
        padding: 16px;
    }
}
