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

:root {
    --primary-color: #4A90E2;
    --primary-light: #6BA3E8;
    --primary-dark: #357ABD;
    --secondary-color: #5DADE2;
    --accent-color: #3498DB;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(74, 144, 226, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* ヘッダー */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.logo:hover {
    color: var(--primary-dark);
}

.logo-image {
    height: 50px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

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

nav a:hover::after {
    width: 100%;
}

/* ボタン */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-white);
    border-color: var(--primary-color);
}

.btn-danger {
    background: #E74C3C;
    color: white;
}

.btn-danger:hover {
    background: #C0392B;
}

/* メインコンテンツ */
main {
    min-height: calc(100vh - 200px);
}

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

/* ヒーローセクション */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

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

/* セクション */
.section {
    padding: 4rem 2rem;
    background: var(--bg-white);
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.section:nth-child(even) {
    background: var(--bg-light);
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-align: center;
}

/* 自己紹介セクション */
.about-content {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
}

.profile-image-container {
    flex-shrink: 0;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.about-text {
    flex: 1;
}

.about-text h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* カード */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

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

.card p {
    color: var(--text-light);
}

/* 実績カード */
.achievement-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.achievement-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.achievement-card .category {
    display: inline-block;
    background: var(--primary-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.achievement-card .date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* ブログカード */
.blog-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.blog-category {
    background: var(--primary-light);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

/* フォーム */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* 管理画面 */
.admin-dashboard {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card p {
    opacity: 0.9;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* 画像プレビュー */
.image-preview {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-preview-item button {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #E74C3C;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

/* ブログ記事詳細 */
.blog-detail {
    max-width: 800px;
    margin: 0 auto;
}

.blog-detail-header {
    margin-bottom: 2rem;
}

.blog-detail-header h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.blog-detail-content {
    line-height: 1.8;
}

.blog-detail-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
}

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

/* ローディング */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav {
        width: 100%;
        text-align: center;
    }

    /* 修正箇所: #nav-menuのdisplay: none; を維持 */
    #nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        display: none; /* デフォルトで非表示 */
        width: 100%;
        margin-top: 1rem;
        /* display: block; */
        /* padding: 0.75rem 0; */
    }

    /* 修正箇所: active時にIDセレクタでdisplay: flex;を設定 */
    #nav-menu.active { /* 👈 ここをIDセレクタとクラスセレクタの組み合わせに変更 */
        display: flex; /* IDセレクタの優先度でdisplay: noneを上書き */
    }

    nav ul.active {
        display: flex;
        /* アクティブ時に表示 */
    }

    .menu-toggle {
        display: flex;
        /* モバイルで表示 */
        flex-direction: column;
        gap: 5px;
        background: transparent;
        color: var(--primary-color);
        border: none;
        padding: 0.5rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 1rem;
        margin-top: 0;
        
    }

    .menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--primary-color);
        border-radius: 2px;
        transition: all 0.3s;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

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

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 2rem 1rem;
    }

    .section h2 {
        font-size: 1.8rem;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-dashboard>div {
        grid-template-columns: 1fr;
    }

    #auth-button {
        display: none;
    }
    .menu-toggle span {
    /* 既存のスタイル */
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s;

    /* 💡 修正案: 回転の基準点を設定 */
    transform-origin: 4px 1px; /* 左上付近のバーの端を回転の基準点にする */
    }

    .menu-toggle.active span:nth-child(1) {
        /* transform-originを設定した場合、translateの値を調整 */
        transform: rotate(45deg); /* translate(8px, 8px)は不要になる可能性が高い */
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        /* transform-originを設定した場合、translateの値を調整 */
        transform: rotate(-45deg); /* translate(8px, -8px)は不要になる可能性が高い */
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* フッター */
footer {
    background: var(--bg-white);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}


footer p {
    color: var(--text-light);
}

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

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

    .section {
        padding: 2rem 1.2rem;
    }

    nav ul {
        background: var(--bg-white);
        border-radius: 8px;
        box-shadow: var(--shadow);
    }


}
/* --- 実績画像のスタイル追加 --- */

/* 画像を横並びにするコンテナ */
.achievement-images {
    display: flex;
    flex-wrap: wrap; /* 複数行に折り返す */
    gap: 10px;       /* 画像間の隙間 */
    margin-top: 10px;
}

/* 小さく表示するサムネイル画像 */
.achievement-thumbnail {
    width: 150px;         /* 幅を固定 */
    height: 100px;        /* 高さを固定 */
    object-fit: cover;    /* 枠に合わせてトリミング */
    cursor: pointer;      /* カーソルを指マークに */
    border-radius: 4px;   /* 角を少し丸く */
    transition: opacity 0.2s;
    border: 1px solid #ddd;
}

.achievement-thumbnail:hover {
    opacity: 0.8; /* ホバー時に少し薄くする */
}

/* --- ライトボックス（拡大表示モーダル）のスタイル --- */

/* モーダル全体（背景の黒い部分） */
.lightbox-modal {
    display: none; /* 初期状態は非表示 */
    position: fixed;
    z-index: 2000; /* 最前面に */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9); /* 背景を半透明の黒に */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* モーダルを表示する時のクラス */
.lightbox-modal.active {
    display: flex;
}

/* 拡大表示される画像 */
.lightbox-content {
    max-width: 100%;
    max-height: 90vh; /* 画面の高さの90%までに制限 */
    object-fit: contain; /* アスペクト比を維持して収める */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* 閉じるボタン（×マーク） */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #bbb;
}

/* モーダル表示中は背景スクロール禁止 */
body.lightbox-open {
    overflow: hidden;
}