/* ==========================================================================
   Lyon Japon - Stylesheet
   ========================================================================== */

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    background: #f5f5f5;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: #c0392b; text-decoration: none; transition: color 0.2s; }
a:hover { color: #e74c3c; }

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

ul, ol { list-style: none; }

/* --- Layout --- */
.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

.site-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 30px 0;
}

.site-main {
    flex: 1;
    min-width: 0;
}

.site-sidebar {
    width: 280px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .site-layout {
        flex-direction: column;
        padding: 15px 0;
    }
    .site-sidebar { width: 100%; }
}

/* --- Header --- */
.site-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

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

.site-nav ul {
    display: flex;
    gap: 20px;
}

.site-nav a {
    color: #555;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
    color: #c0392b;
    border-bottom-color: #c0392b;
}

/* Mobile menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    padding: 5px;
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .site-nav { display: none; }
    .site-nav.open {
        display: block;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 15px;
    }
    .site-nav.open ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* --- Article Cards (listing) --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.post-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-card-image {
    width: 300px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

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

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(192, 57, 43, 0.9);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 600;
    z-index: 2;
}

.post-card-category:hover { color: #fff; }

.post-card-date {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    z-index: 2;
}

.post-card-date .day { font-size: 1.1rem; font-weight: 700; line-height: 1.2; color: #333; }
.post-card-date .month { font-size: 0.75rem; color: #666; line-height: 1; }
.post-card-date .year { font-size: 0.6rem; color: #999; line-height: 1; }

.post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.post-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card-title a { color: #222; }
.post-card-title a:hover { color: #c0392b; }

.post-card-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c0392b;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more:hover { gap: 8px; }

@media (max-width: 600px) {
    .post-card { flex-direction: column; }
    .post-card-image { width: 100%; height: 200px; }
}

/* --- Single Article --- */
.article-single {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 30px;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: #c0392b; }
.breadcrumb .sep { margin: 0 3px; }

.article-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.article-meta i { margin-right: 4px; }

.article-featured-image {
    margin-bottom: 25px;
    border-radius: 4px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.article-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c0392b;
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 25px 0 10px;
}

.article-body p {
    margin-bottom: 15px;
}

.article-body blockquote {
    border-left: 4px solid #c0392b;
    padding: 15px 20px;
    margin: 20px 0;
    background: #fafafa;
    font-style: italic;
    color: #555;
}

.article-body ul, .article-body ol {
    margin: 15px 0;
    padding-left: 25px;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 5px; }

/* Table of Contents */
.toc {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 25px;
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
}

.toc ol {
    list-style: decimal;
    padding-left: 20px;
}

.toc li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.toc a { color: #555; }
.toc a:hover { color: #c0392b; }

/* Article category tag */
.article-category {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.article-category a {
    display: inline-block;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    border: 1px solid #ddd;
}

.article-category a:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

/* Post navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 25px;
}

.post-nav-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    transition: background 0.2s;
}

.post-nav-link:hover { background: #f0f0f0; }

.post-nav-link.next { flex-direction: row-reverse; text-align: right; }

.post-nav-link img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.post-nav-label {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-bottom: 3px;
}

.post-nav-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .post-navigation { flex-direction: column; }
    .post-nav-link.next { flex-direction: row; text-align: left; }
    .article-single { padding: 20px; }
    .article-title { font-size: 1.4rem; }
}

/* --- Author Box --- */
.author-box {
    margin-top: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 15px;
}

.author-box img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-box-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- Sidebar --- */
.sidebar-widget {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-widget h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #c0392b;
    color: #222;
}

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

.sidebar-widget li {
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.sidebar-widget li:last-child { border-bottom: none; }

.sidebar-widget li a { color: #555; }
.sidebar-widget li a:hover { color: #c0392b; }

/* Search */
.search-form {
    display: flex;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
    outline: none;
}

.search-form input[type="search"]:focus {
    border-color: #c0392b;
}

.search-form button {
    padding: 8px 15px;
    background: #c0392b;
    color: #fff;
    border: 1px solid #c0392b;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

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

/* --- Footer --- */
.site-footer {
    background: #2c3e50;
    color: #aaa;
    text-align: center;
    padding: 25px 0;
    margin-top: 30px;
}

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

.back-to-top {
    display: inline-block;
    margin-bottom: 15px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: #ddd;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.back-to-top:hover { background: rgba(255,255,255,0.2); color: #fff; }

.copyright {
    font-size: 0.85rem;
}

/* --- Archive / Category Header --- */
.archive-header {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 20px 25px;
    margin-bottom: 25px;
}

.archive-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.pagination .current {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
    font-weight: 600;
}

/* --- Utility --- */
.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
}
