:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #45b7d1;
    --warm-orange: #ffa726;
    --soft-green: #66bb6a;
    --background-color: #fef7f0;
    --surface-color: #ffffff;
    --text-color: #2d3748;
    --text-color-light: #ffffff;
    --border-color: #e2e8f0;
    --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.95);
    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 {
    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: 800px;
    justify-content: center;
}

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

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

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

/* Hero Section */
.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(135deg, rgba(255, 107, 107, 0.7), rgba(78, 205, 196, 0.6));
    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;
}

/* Main Content */
.page-wrapper {
    padding: 4rem 0;
}

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

/* モバイルではサイドバーを先に表示 */
.main-content .article-content {
    order: 2;
}

.main-content .sidebar {
    order: 1;
}

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

    /* デスクトップでは通常の順序に戻す */
    .main-content .article-content {
        order: 1;
    }

    .main-content .sidebar {
        order: 2;
    }
}

.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 */
.feature-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-grid-item {
    background: linear-gradient(135deg, #fff, #fef7f0);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

.feature-grid-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.btn-read-more {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--warm-orange));
    color: var(--text-color-light);
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 1rem;
    transition: all var(--transition-speed);
}

.btn-read-more:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: var(--text-color-light);
    transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

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

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

.toc ul {
    list-style: none;
}

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

.toc ul li a:hover {
    background-color: var(--background-color);
    color: var(--secondary-color);
}

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

.news-list li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.news-list li:last-child {
    border-bottom: none;
}

.news-list a {
    color: var(--text-color);
    font-size: 0.9rem;
}

.news-list a:hover {
    color: var(--primary-color);
}

.related-links {
    list-style: none;
}

.related-links li {
    margin-bottom: 0.5rem;
}

.related-links a {
    color: var(--accent-color);
    font-size: 0.9rem;
}

.related-links a:hover {
    color: var(--primary-color);
}

.ad-space {
    height: 250px;
    background: linear-gradient(135deg, var(--soft-green), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    font-weight: bold;
    border-radius: 8px;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-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;
}

/* Responsive */
@media (max-width: 991px) {
    .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;
    }

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

    .hamburger {
        display: block;
    }

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

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

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

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

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

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

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

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

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

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

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