:root {
    --primary-color: #4A90E2;
    --secondary-color: #2E4A6B;
    --background-color: #F5F7FA;
    --surface-color: #ffffff;
    --text-color: #333333;
    --text-color-light: #f5f5f5;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);

    --font-family-base: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    --font-family-heading: 'Georgia', 'Times New Roman', 'Hiragino Mincho ProN', serif;

    --header-height: 70px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-family-base);
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--secondary-color);
    line-height: 1.3;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

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

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

header, .header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow var(--transition-speed);
}

header.scrolled, .header.scrolled {
    box-shadow: 0 2px 10px var(--shadow-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo a {
    font-family: var(--font-family-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    max-width: 900px;
    justify-content: center;
}

.nav-item a {
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-item a:hover, .nav-item a.active {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hero {
    position: relative;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-light);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-color-light);
}

.hero p {
    font-size: 1.2rem;
}

.page-wrapper {
    padding: 4rem 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 3fr 1fr;
    }
}

.article-content {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.article-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.5rem;
}

.article-meta {
    font-size: 0.9rem;
    color: #666;
}

.article-content section {
    margin-bottom: 2.5rem;
}

.article-content h2 {
    font-size: 2rem;
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;
    margin-top: 2rem;
}

.article-content h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
}

.article-content p, .article-content ul {
    margin-bottom: 1rem;
}

.article-content ul {
    padding-left: 1.5rem;
}

.article-content img.inline-image {
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.feature-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-grid-item {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px var(--shadow-color);
}

.feature-grid-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
}

.feature-grid-item p {
    margin-bottom: 1rem;
    color: #666;
}

.btn-read-more {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background-color: var(--primary-color);
    color: var(--text-color-light);
    border-radius: 5px;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.btn-read-more:hover {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
}

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    align-self: flex-start;
}

.sidebar-widget {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.toc ul, .news-list, .related-links {
    list-style: none;
}

.toc ul li a, .news-list li a, .related-links li a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem;
}

.toc ul li a:hover, .news-list li a:hover, .related-links li a:hover {
    background-color: var(--background-color);
    padding-left: 0.5rem;
}

.news-list li {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.ad-space {
    height: 250px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    border-radius: 8px;
}

footer, .footer {
    background-color: var(--secondary-color);
    color: var(--text-color-light);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.footer-nav a {
    color: var(--text-color-light);
    opacity: 0.8;
}

.footer-nav a:hover {
    opacity: 1;
}

.copyright {
    font-size: 0.9rem;
}

@media (max-width: 991px) {
    /* モバイルでサイドバーを先に表示 */
    .sidebar {
        order: -1;
    }

    .article-content {
        order: 1;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--surface-color);
        box-shadow: 0 4px 10px var(--shadow-color);
        padding: 1rem 0;
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger {
        display: block;
        width: 30px;
        height: 25px;
        position: relative;
        z-index: 1001;
    }

    .hamburger-inner,
    .hamburger-inner::before,
    .hamburger-inner::after {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--text-color);
        border-radius: 3px;
        position: absolute;
        transition: transform 0.3s, top 0.3s, bottom 0.3s;
    }

    .hamburger-inner {
        top: 50%;
        transform: translateY(-50%);
    }

    .hamburger-inner::before,
    .hamburger-inner::after {
        content: '';
        left: 0;
    }

    .hamburger-inner::before {
        top: -8px;
    }

    .hamburger-inner::after {
        bottom: -8px;
    }

    .hamburger.active .hamburger-inner {
        transform: rotate(45deg);
        top: 50%;
    }

    .hamburger.active .hamburger-inner::before {
        top: 0;
        transform: rotate(90deg);
    }

    .hamburger.active .hamburger-inner::after {
        bottom: 0;
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .article-header h1 {
        font-size: 2rem;
    }

    .article-content h2 {
        font-size: 1.7rem;
    }

    .feature-grid-container {
        grid-template-columns: 1fr;
    }
}
