@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --bg-color: #fffdf8;
    --surface-color: #ffffff;
    --surface-muted: #f7f3ea;
    --text-color: #1f1f1f;
    --text-muted: #5f665f;
    --border-color: #ebe5d8;
    --accent-color: #2f5d50;
    --accent-muted: #eef4ef;
    --header-height: 64px;
    --footer-height: auto;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Noto Sans JP", sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(255, 253, 248, 0.94);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.site-header .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 32px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition: transform 0.2s, opacity 0.2s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 48px;
    white-space: nowrap;
}

nav.main-nav {
    display: flex;
    gap: 32px;
    margin-left: auto;
}

nav.main-nav a {
    font-size: 0.9rem;
    font-weight: 500;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--surface-muted);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: var(--surface-color);
    border-color: var(--accent-color);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-menu {
    display: none;
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Articles */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 48px 32px;
    padding: 64px 0;
}

.article-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    position: relative;
}

.article-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-muted);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.article-card:hover .article-image img {
    transform: scale(1.03);
}

.article-card:hover h3 {
    color: var(--accent-color);
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.article-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-muted);
}

.article-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Footer */
footer {
    background: var(--surface-muted);
    border-top: 1px solid var(--border-color);
    padding: 64px 20px;
    margin-top: 40px;
    text-align: center;
}

.footer-main {
    max-width: 600px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-main .logo {
    margin-bottom: 16px;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 0;
}

.footer-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
    max-width: 480px;
}

.footer-links-secondary {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: nowrap;
}

.footer-links-secondary a {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social-link {
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social-link:hover {
    color: var(--accent-color);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    height: 64px;
    z-index: 1000;
}

.mobile-nav .container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-muted);
}

.mobile-nav-item.active {
    color: var(--accent-color);
}

/* Article List Section */
.row-link {
    color: inherit;
    text-decoration: none;
}

.page-hero {
    padding: 40px 0 20px;
    background-color: var(--surface-muted);
    border-bottom: 1px solid var(--border-color);
}

.page-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.page-hero p {
    color: var(--text-muted);
    max-width: 720px;
}

.article-list-section {
    padding: 24px 0 64px;
    background-color: var(--bg-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 720px;
}

.col-number {
    width: 72px;
    white-space: nowrap;
}

.col-status {
    width: 88px;
    white-space: nowrap;
}

.book-status-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--surface-muted);
    color: var(--text-muted);
}

.book-status-read {
    background-color: var(--accent-muted);
    color: var(--accent-color);
}

.book-status-tsundoku {
    background-color: var(--surface-muted);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.article-meta .book-status-badge {
    font-size: 0.65rem;
    text-transform: none;
    letter-spacing: 0;
}

.row-link-muted {
    color: var(--text-muted);
}

.book-meta-line {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.book-external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.book-external-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    background: var(--surface-color);
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.book-external-link:hover {
    border-color: var(--accent-color);
    background: var(--accent-muted);
    color: var(--accent-color);
}

.book-empty-notice {
    color: var(--text-muted);
    padding: 24px;
    background: var(--surface-muted);
    border-radius: 8px;
    text-align: center;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--surface-muted);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr:hover {
    background-color: var(--accent-muted);
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--surface-muted);
}

.status-published {
    background-color: var(--accent-muted);
    color: var(--accent-color);
}

.book-filters {
    margin-bottom: 24px;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-muted);
}

.book-filter-group + .book-filter-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.book-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.book-filter-tag,
.book-range-tag {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
    font-family: inherit;
}

.book-filter-tag:hover,
.book-range-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.book-filter-tag.active,
.book-range-tag.active {
    border-color: var(--accent-color);
    background: var(--accent-muted);
    color: var(--accent-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-color);
    background: var(--accent-muted);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface-color);
    font-family: inherit;
    color: inherit;
    padding: 0;
}

.page-num:hover {
    border-color: var(--accent-color);
}

.page-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    user-select: none;
}

.page-num.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* Article Detail */
.article-detail {
    padding: 32px 0 16px;
}

.article-header {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    padding: 0 20px;
}

.article-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 24px;
}

.article-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.article-main-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 48px;
    border-radius: 8px;
    overflow: hidden;
    padding: 0 20px;
}

.article-main-image img {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.article-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 48px 0 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 40px 0 20px;
}

.article-body p {
    margin-bottom: 24px;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-color);
}

.article-body ul, .article-body ol {
    margin-bottom: 32px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 12px;
}

.article-body blockquote {
    margin: 40px 0;
    padding: 32px;
    background: var(--surface-muted);
    border-left: 4px solid var(--accent-color);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.article-body figure {
    margin: 40px 0;
}

.article-body figure img {
    width: 100%;
    border-radius: 4px;
}

.article-body figcaption {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.article-body table {
    margin: 24px 0;
}

.article-body thead th {
    background: var(--surface-muted);
}

.article-footer {
    max-width: 800px;
    margin: 48px auto 0;
    padding: 32px 20px;
    border-top: 1px solid var(--border-color);
}

.article-footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 4px 0;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-icon:hover {
    border-color: var(--accent-color);
    color: #fff;
    background: var(--accent-color);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 12px;
    background: var(--accent-muted);
    border-radius: 20px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        gap: 12px;
    }

    .menu-toggle {
        display: flex;
    }

    .logo {
        margin-right: 0;
        font-size: 1rem;
        overflow: hidden;
    }

    .logo span {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    header .main-nav, header .search-box {
        display: none;
    }

    .mobile-menu {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: rgba(255, 253, 248, 0.98);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        transform: translateY(-120%);
        transition: transform 0.2s ease;
        z-index: 999;
        box-shadow: 0 12px 24px rgba(47, 93, 80, 0.08);
    }

    .mobile-menu.is-open {
        transform: translateY(0);
    }

    .mobile-menu nav {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 20px;
    }

    .mobile-menu nav a {
        padding: 12px 0;
        font-size: 0.95rem;
        font-weight: 600;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu .search-box {
        display: block;
        width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .mobile-nav {
        display: block;
    }

    body {
        padding-bottom: 64px;
    }

    .footer-links-secondary {
        gap: 12px;
    }

    .footer-links-secondary a {
        font-size: 0.75rem;
    }

    .footer-main .logo {
        font-size: 1.25rem;
    }
}
