
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-container {
    flex-grow: 1;
}

/* --- Header & Navigation --- */
.home-header {
    background-color: #5d9cec;
    color: white;
    /* Padding is now applied to internal elements */
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 960px; /* Match main container width */
    margin: 0 auto;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.nav-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.header-content {
    text-align: center;
    padding: 2rem 1rem;
}

.header-content h1 {
    margin: 0;
    font-size: 2.5rem;
}

.sub-copy {
    font-size: 1.2rem;
    opacity: 0.9;
}
/* --- Main Content --- */
.main-container {
    max-width: 960px; /* 全体の幅を縮小 */
    margin: 2rem auto;
    padding: 0 1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 横4列に固定 */
    gap: 1.25rem; /* ギャップを少し縮小 */
}

.category-title {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.tool-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1.618; /* 黄金比の縦長に設定 */
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-icon-area {
    width: 100%;
    aspect-ratio: 1 / 1; /* 上部を正方形に */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.card-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    box-sizing: border-box;
}

.card-text-area {
    padding: 0.8rem; /* パディングを縮小 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    overflow: hidden;
}

.card-title {
    font-size: 1rem; /* フォントサイズを縮小 */
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.card-description {
    font-size: 0.8rem; /* フォントサイズを縮小 */
    line-height: 1.4;
    text-align: center;
    margin-top: 0.4rem; /* マージンを縮小 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .main-nav, .main-container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-nav {
       flex-direction: column;
       gap: 1rem;
    }
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Footer --- */
.home-footer {
    background-color: #333;
    color: #f4f7f6;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav a {
    color: #f4f7f6;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s ease;
}

.footer-nav a:hover {
    color: #5d9cec;
}

.copyright {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
}


/* --- Blog Styles --- */
.page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-item {
    margin-bottom: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: box-shadow 0.2s ease-in-out;
}

.post-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.post-item a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: inherit;
}

.post-date {
    font-size: 0.9rem;
    color: #666;
    min-width: 100px;
}

.post-title {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
}

/* Single Post Styles */
.post-container {
    max-width: 800px;
}

.post-article {
    background-color: #fff;
    border-radius: 8px;
    padding: 2rem 3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.post-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.post-meta {
    color: #666;
    font-size: 1rem;
}

.post-content {
    line-height: 1.7;
}

.post-content h2, .post-content h3, .post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #eee;
}

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

.post-content code {
    background-color: #eee;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

.post-content pre {
    background-color: #2d2d2d;
    color: #f1f1f1;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
}

.back-to-list {
    display: inline-block;
    margin-top: 2rem;
    color: #5d9cec;
    text-decoration: none;
    font-weight: 500;
}

.back-to-list:hover {
    text-decoration: underline;
}
