/*
Theme Name: Peter95 Blog
Theme URI: https://peter95.blog
Author: Peter95
Author URI: https://peter95.blog
Description: Brunch-style minimal blog theme. Black & red monotone, clean typography, reading-focused layout.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: peter95-blog
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1A1A1A;
    background-color: #FFFFFF;
    line-height: 1.8;
    word-break: keep-all;
    overflow-wrap: break-word;
}

a {
    color: #E53E3E;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #C53030;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ===== LAYOUT ===== */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 20px 80px;
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #FFFFFF;
    border-bottom: 1px solid #E5E5E5;
}

.header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-title a {
    color: #1A1A1A;
}

.site-title a:hover {
    color: #E53E3E;
}

.main-navigation ul {
    display: flex;
    gap: 24px;
}

.main-navigation a {
    color: #333333;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.main-navigation a:hover {
    color: #E53E3E;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #1A1A1A;
    margin: 4px 0;
    transition: transform 0.2s ease;
}

/* ===== INDEX / ARCHIVE: POST LIST ===== */
.page-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E5E5E5;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1A1A1A;
    letter-spacing: -0.02em;
}

.page-description {
    margin-top: 8px;
    font-size: 0.9375rem;
    color: #333333;
}

.post-list-item {
    padding: 32px 0;
    border-bottom: 1px solid #E5E5E5;
}

.post-list-item:first-child {
    padding-top: 0;
}

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

.post-list-link {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.post-list-content {
    flex: 1;
    min-width: 0;
}

.post-list-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.post-list-title a {
    color: #1A1A1A;
}

.post-list-title a:hover {
    color: #E53E3E;
}

.post-list-excerpt {
    font-size: 0.9375rem;
    color: #333333;
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-list-meta {
    font-size: 0.8125rem;
    color: #999999;
}

.post-list-meta .category-link {
    color: #E53E3E;
    font-weight: 500;
}

.post-list-meta .separator {
    margin: 0 6px;
}

.post-list-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
}

.post-list-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== SINGLE POST ===== */
.single-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #E5E5E5;
}

.single-category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #E53E3E;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.single-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.single-meta {
    font-size: 0.875rem;
    color: #999999;
}

.single-content {
    max-width: 680px;
    margin: 0 auto;
}

/* ===== ARTICLE CONTENT ===== */
.entry-content {
    font-size: 1.0625rem;
    line-height: 1.9;
    color: #1A1A1A;
}

.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 56px 0 20px;
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 40px 0 16px;
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.entry-content h4 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 32px 0 12px;
    line-height: 1.4;
}

.entry-content p {
    margin-bottom: 24px;
}

.entry-content img {
    margin: 32px 0;
    border-radius: 4px;
}

.entry-content figure {
    margin: 32px 0;
}

.entry-content figcaption {
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #999999;
    text-align: center;
}

.entry-content blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    border-left: 3px solid #E53E3E;
    background-color: #FAFAFA;
    font-style: italic;
    color: #333333;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content ul,
.entry-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 8px;
}

.entry-content pre {
    margin: 32px 0;
    padding: 24px;
    background-color: #1A1A1A;
    color: #E5E5E5;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.entry-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background-color: #F5F5F5;
    padding: 2px 6px;
    border-radius: 3px;
}

.entry-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
}

.entry-content hr {
    border: none;
    border-top: 1px solid #E5E5E5;
    margin: 48px 0;
}

.entry-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
}

.entry-content th,
.entry-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #E5E5E5;
    text-align: left;
    font-size: 0.9375rem;
}

.entry-content th {
    font-weight: 700;
    border-bottom: 2px solid #1A1A1A;
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation .nav-link {
    flex: 1;
    min-width: 0;
}

.post-navigation .nav-link.next {
    text-align: right;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.75rem;
    color: #999999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-navigation .nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.4;
}

.post-navigation a:hover .nav-title {
    color: #E53E3E;
}

/* ===== PAGE ===== */
.page-content .entry-content {
    max-width: 680px;
    margin: 0 auto;
}

.page-content .page-title-main {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 40px;
    text-align: center;
}

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.875rem;
    color: #333333;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination .page-numbers.current {
    background-color: #1A1A1A;
    color: #FFFFFF;
    font-weight: 600;
}

.pagination .page-numbers:hover:not(.current):not(.dots) {
    background-color: #F5F5F5;
}

.pagination .page-numbers.dots {
    cursor: default;
}

/* ===== SEARCH FORM ===== */
.search-form {
    display: flex;
    max-width: 480px;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #E5E5E5;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-family: inherit;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-form .search-field:focus {
    border-color: #1A1A1A;
}

.search-form .search-submit {
    padding: 10px 20px;
    background-color: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #1A1A1A;
    border-radius: 0 4px 4px 0;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-form .search-submit:hover {
    background-color: #333333;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 .error-code {
    font-size: 6rem;
    font-weight: 700;
    color: #E5E5E5;
    line-height: 1;
    margin-bottom: 16px;
}

.error-404 .error-message {
    font-size: 1.25rem;
    color: #333333;
    margin-bottom: 32px;
}

/* ===== FOOTER ===== */
.site-footer {
    border-top: 1px solid #E5E5E5;
    padding: 24px 20px;
    text-align: center;
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    font-size: 0.8125rem;
    color: #999999;
}

/* ===== SIDEBAR / WIDGETS ===== */
.widget {
    margin-bottom: 32px;
}

.widget-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    color: #1A1A1A;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 6px 0;
    font-size: 0.9375rem;
}

.widget a {
    color: #333333;
}

.widget a:hover {
    color: #E53E3E;
}

/* ===== COMMENTS ===== */
.comments-area {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #E5E5E5;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.comments-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
}

.comment-body {
    padding: 20px 0;
    border-bottom: 1px solid #F5F5F5;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 4px;
}

.comment-meta {
    font-size: 0.8125rem;
    color: #999999;
    margin-bottom: 12px;
}

.comment-content {
    font-size: 0.9375rem;
    line-height: 1.7;
}

.comment-respond .comment-reply-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9375rem;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.comment-form textarea:focus,
.comment-form input:focus {
    border-color: #1A1A1A;
}

.comment-form .form-submit input {
    padding: 10px 24px;
    background-color: #1A1A1A;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.comment-form .form-submit input:hover {
    background-color: #333333;
}

/* ===== ALIGNMENTS (WP) ===== */
.alignleft {
    float: left;
    margin-right: 24px;
    margin-bottom: 16px;
}

.alignright {
    float: right;
    margin-left: 24px;
    margin-bottom: 16px;
}

.aligncenter {
    display: block;
    margin: 32px auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.8125rem;
    color: #999999;
    margin-top: 8px;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-inner {
        height: 52px;
    }

    .main-navigation {
        display: none;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        background: #FFFFFF;
        border-bottom: 1px solid #E5E5E5;
        padding: 16px 20px;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 12px;
    }

    .menu-toggle {
        display: block;
    }

    .site-content {
        padding: 40px 16px 60px;
    }

    .post-list-link {
        flex-direction: column-reverse;
        gap: 16px;
    }

    .post-list-thumbnail {
        width: 100%;
        height: 200px;
    }

    .post-list-item {
        padding: 24px 0;
    }

    .single-title {
        font-size: 1.5rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .post-navigation .nav-link.next {
        text-align: left;
    }

    .error-404 .error-code {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1rem;
    }

    .single-title {
        font-size: 1.375rem;
    }

    .page-title {
        font-size: 1.25rem;
    }
}
