/* --- Reset & Base --- */
:root {
    --primary-color: #007bff;
    /* ロゴの青 */
    --text-color: #343A40;
    /* ダークグレー */
    --subtext-color: #6c757d;
    /* ミディアムグレー */
    --bg-color: #FFFFFF;
    /* 白 */
    --light-bg-color: #F8F9FA;
    /* 薄いグレー */
    --border-color: #DEE2E6;
    --accent-pink-light: #FCE4EC;
    --accent-pink-medium: #F8BBD0;
    --accent-pink-dark: #F48FB1;
    --accent-red: #FFCDD2;
    --accent-green: #81C784;

    --font-title: 'M PLUS Rounded 1c', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;

    --content-width: 1100px;
    --padding-base: 1rem;
    --padding-large: 2rem;
    --border-radius-small: 4px;
    --border-radius-medium: 8px;
    --border-radius-large: 16px;
    --border-radius-round: 999px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: darken(var(--primary-color), 10%);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.8em;
    line-height: 1.3;
    font-weight: 700;
    /* Noto Sans JP Bold */
}

h1 {
    font-size: 2.2rem;
    font-family: var(--font-title);
}

h2 {
    font-size: 1.8rem;
}

/* article-title で上書き */
h3 {
    font-size: 1.5rem;
}

/* article-subtitle で上書き */
h4 {
    font-size: 1.2rem;
}

/* article-subsubtitle で上書き */

p {
    margin-bottom: 1.2em;
}

strong,
b {
    font-weight: 700;
}

/* --- Layout --- */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--padding-base);
}

.main-content {
    padding: var(--padding-large) 0;
}

/* --- Header --- */
.site-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: var(--padding-base) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--padding-base);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.logo-link:hover {
    text-decoration: none;
}

.logo-image {
    width: 35px;
    height: 35px;
    margin-right: 0.5rem;
}

.site-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
}

.menu-toggle-button {
    display: none;
    /* PCでは非表示 */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

.global-navigation ul {
    display: flex;
    gap: 1.5rem;
}

.global-navigation li {
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    /* Medium */
    color: var(--subtext-color);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    /* JavaScriptでアクティブクラスを付与する場合 */
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}


/* --- Tag Filter --- */
.tag-filter-container {
    margin-bottom: var(--padding-large);
    text-align: center;
}

.filter-label {
    font-weight: 500;
    margin-right: 0.8rem;
    color: var(--subtext-color);
}

.tag-button {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    /* 背景色に応じて調整 */
    cursor: pointer;
    padding: 0.4rem 0.9rem;
    margin: 0.3rem;
    border: none;
    border-radius: var(--border-radius-round);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 色はインラインスタイルで設定 */

.tag-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.tag-button.active {
    /* JavaScriptで付与 */
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* --- Articles Grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--padding-large);
}

.article-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    padding: var(--padding-large);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    /* 角丸のため */
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.article-title {
    font-family: var(--font-title);
    font-size: 1.4rem;
    /* カード内では少し小さめに */
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.article-content {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.75;
}

.article-content p {
    margin-bottom: 1em;
}

.article-content ul,
.article-content ol {
    list-style: disc;
    /* または decimal */
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.article-content ul li,
.article-content ol li {
    margin-bottom: 0.5em;
}

.article-subtitle {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--accent-pink-light);
}

.article-subsubtitle {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    color: var(--primary-color);
}

.article-image {
    border-radius: var(--border-radius-medium);
    margin: 1.5rem auto;
    /* 中央寄せ */
    display: block;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.text-link {
    /* 記事内リンク */
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--accent-pink-medium);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.text-link:hover {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

.section-point {
    font-weight: 700;
    margin-top: 1.5em;
    color: var(--primary-color);
}

.quote {
    font-style: italic;
    padding-left: 1em;
    border-left: 3px solid var(--accent-pink-medium);
    color: var(--subtext-color);
    margin: 1.5em 0;
}

.cta-button-container {
    text-align: center;
    margin: 2rem 0 1rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius-round);
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: darken(var(--primary-color), 10%);
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.article-tags {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tag-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
    /* 背景色に応じて調整 */
    padding: 0.25rem 0.6rem;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
    border-radius: var(--border-radius-small);
}

/* 色はインラインスタイルで設定 */

/* --- Footer --- */
.site-footer {
    background-color: var(--accent-pink-light);
    /* かわいい色に */
    color: var(--text-color);
    padding: var(--padding-large) 0;
    margin-top: var(--padding-large);
    border-top: 1px solid var(--border-color);
}

.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--padding-base);
    text-align: center;
}

.copyright {
    font-size: 0.85rem;
    color: var(--subtext-color);
    margin-bottom: 1rem;
}

.copyright a {
    color: var(--subtext-color);
}

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

.footer-nav ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-nav a {
    font-size: 0.85rem;
    color: var(--subtext-color);
}

.footer-nav a:hover {
    color: var(--primary-color);
}

/* --- Back to Top Button --- */
.back-to-top-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s ease;
    z-index: 100;
}

.back-to-top-button:hover {
    background-color: darken(var(--primary-color), 10%);
}

/* --- Ads --- */
.ad-container {
    margin: var(--padding-large) auto;
    max-width: 728px;
    /* AdSenseの推奨サイズに合わせるなど */
    text-align: center;
}

.footer-ad {
    margin-top: 0;
    padding-bottom: var(--padding-base);
}

/* --- Responsive (Mobile First) --- */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .site-title {
        font-size: 1.3rem;
    }

    .menu-toggle-button {
        display: block;
        /* スマホで表示 */
    }

    .global-navigation {
        display: none;
        /* 初期状態は非表示 */
        position: absolute;
        top: 100%;
        /* ヘッダーの下に */
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        padding: var(--padding-base) 0;
    }

    .global-navigation.active {
        display: block;
        /* activeクラスで表示 */
    }

    .global-navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-link {
        display: block;
        padding: 0.8rem var(--padding-base);
        width: 100%;
        text-align: center;
    }

    .nav-link::after {
        display: none;
        /* スマホでは下線なし */
    }

    .articles-grid {
        grid-template-columns: 1fr;
        /* スマホでは1カラム */
        gap: var(--padding-large);
    }

    .tag-filter-container {
        text-align: left;
        padding: 0 var(--padding-base);
    }

    .filter-label {
        display: block;
        margin-bottom: 0.5rem;
    }

    .tag-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }

    .back-to-top-button {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}