/* ============================================================
   パルキッズ通信ウェブマガジン
   ============================================================ */

/* ---- 記事ページ共通 ---- */
.wm-article-page { background: var(--bg-color, #f4f0e9); }

.wm-article {
    padding: 40px 20px 80px;
}

.wm-article-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 8px;
    color: var(--primary-color, #2c5f8d);
}

/* 小見出し・byline エリア */
.wm-article-header-sub {
    margin: 0 0 24px;
    border-bottom: 1px solid #dde4ec;
    padding-bottom: 14px;
}
.wm-article-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: #444;
    margin: 0 0 6px;
    line-height: 1.5;
}
.wm-article-byline {
    font-size: .88rem;
    color: #888;
    margin: 0;
    font-style: italic;
}

/* ---- Podcast ボタン ---- */
.wm-podcast-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 28px;
}

.wm-podcast-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 24px;
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
    line-height: 1.4;
}

.wm-podcast-btn:hover { opacity: .82; transform: translateY(-1px); }

.wm-podcast-btn--apple    { background: #d02424; color: #fff; }
.wm-podcast-btn--episode  { background: var(--primary-color, #2c5f8d); color: #fff; }

/* ---- サマリー ---- */
.wm-summary {
    background: #f7f9fc;
    border: 1px solid #c5d8e8;
    border-radius: 6px;
    padding: 20px 24px 18px;
    margin: 0 0 28px;
    font-size: .95rem;
    line-height: 1.9;
}

.wm-summary-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color, #2c5f8d);
    margin: 0 0 10px;
    letter-spacing: .02em;
}

.wm-summary-sep {
    border: none;
    border-top: 1px solid #c5d8e8;
    margin: 0 0 14px;
}

.wm-summary-body {
    color: #333;
    margin: 0 0 12px;
}

.wm-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 24px;
}

.wm-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: #e8f0f8;
    border: 1px solid #c5d8ec;
    color: var(--primary-color, #2c5f8d);
    font-size: .82rem;
    text-decoration: none;
    transition: background .15s, opacity .15s;
}
.wm-tag:hover { background: #d0e3f4; opacity: .9; }

/* ---- 引用・転載元 ---- */
.wm-citation {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 18px;
    margin: 0 0 28px;
    font-size: .82rem;
    color: #555;
    line-height: 1.65;
}

.wm-citation p                  { margin: 0 0 6px; }
.wm-citation p:last-child        { margin: 0; }
.wm-citation a                  { color: var(--primary-color, #2c5f8d); word-break: break-all; }

/* ---- 本文コンテンツ ---- */
.wm-content { margin: 0 0 48px; }

.wm-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color, #2c5f8d);
    border-bottom: 2px solid var(--secondary-color, #f59e42);
    padding-bottom: 8px;
    margin: 40px 0 16px;
}

.wm-content h3 { font-size: 1.12rem; font-weight: 600; margin: 28px 0 12px; }
.wm-content h4 { font-size: 1rem;    font-weight: 600; margin: 20px 0 10px; }

.wm-content p           { line-height: 1.9; margin: 0 0 16px; }
.wm-content ul,
.wm-content ol          { padding-left: 1.6em; margin: 0 0 16px; }
.wm-content li          { line-height: 1.75; margin-bottom: 6px; }
.wm-content blockquote  {
    border-left: 3px solid #ccc;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    color: #555;
    background: #fafafa;
    border-radius: 0 4px 4px 0;
}
.wm-content a           { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.wm-content a:hover     { text-decoration-style: solid; }
.wm-content code        { background: #f0f4f8; padding: 1px 5px; border-radius: 3px; font-size: .9em; }
.wm-content pre         { background: #f0f4f8; padding: 16px; border-radius: 6px; overflow-x: auto; margin: 0 0 16px; }
.wm-content pre code    { background: none; padding: 0; }

/* ---- イントロ（最初の h2 より前のコンテンツ） ---- */
.wm-section-intro { margin: 0 0 32px; }

/* ---- 本文内インライン画像（Markdown 変換コンテンツ用）---- */
/* 段落の先頭に置かれた画像をフロートレイアウトで表示 */
.wm-section-text p > img:first-child {
    float: left;
    width: 30%;
    max-width: 30%;
    margin: 4px 24px 16px 0;
    border-radius: 8px;
    height: auto;
}
/* p::after clearfix は削除 — .wm-section-body の overflow:hidden が float を囲い込む */
@media (max-width: 640px) {
    .wm-section-text p > img:first-child {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 16px;
    }
}

/* ---- セクション（イメージ + テキスト） ---- */
.wm-section { margin: 0 0 40px; }

/* h2 は全幅（float より上）で表示 */
.wm-section-heading { margin: 0; }

/* float コンテキスト */
.wm-section-body { overflow: hidden; }
.wm-section-body::after { content: ''; display: table; clear: both; }

/* 画像ラッパー: float の単位はグループ全体 */
.wm-section-imgs { width: 30%; }

/* 奇数セクション: 画像グループ 左 */
.wm-section--img-left  .wm-section-imgs { float: left;  margin: 4px 24px 16px 0; }
/* 偶数セクション: 画像グループ 右 */
.wm-section--img-right .wm-section-imgs { float: right; margin: 4px 0 16px 24px; }

/* 個々の figure は幅 100%（ラッパー基準）で縦積み */
.wm-section-img { margin: 0; width: 100%; }
.wm-section-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* 複数枚のとき: 画像間に余白 */
.wm-section-imgs--multi .wm-section-img + .wm-section-img { margin-top: 12px; }

/* スマホ: float 解除 → 画像グループ全幅、下にテキスト */
@media (max-width: 640px) {
    .wm-section--img-left  .wm-section-imgs,
    .wm-section--img-right .wm-section-imgs {
        float: none;
        width: 100%;
        margin: 0 0 16px;
    }
}

/* ---- 関連記事 ---- */
.wm-related {
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    margin: 0 0 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wm-related-heading { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; color: var(--primary-color, #2c5f8d); }

.wm-related-list { list-style: none; padding: 0; margin: 0; }

.wm-related-list li {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
}

.wm-related-list li:last-child { border: none; padding-bottom: 0; }

.wm-related-list a {
    color: inherit;
    text-decoration: none;
    display: block;
    line-height: 1.55;
    transition: color .15s;
}

.wm-related-list a::before { content: '→ '; color: var(--secondary-color, #f59e42); }
.wm-related-list a:hover   { color: var(--primary-color, #2c5f8d); }

/* ---- 著者プロフィール ---- */
.wm-author-profile {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.wm-author-photo { flex-shrink: 0; margin: 0; }

.wm-author-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.wm-author-name     { font-size: 1rem; font-weight: 700; margin: 0 0 8px; }
.wm-author-bio-text { font-size: .9rem; line-height: 1.75; color: #555; }

@media (max-width: 640px) {
    .wm-article-title { font-size: 1.4rem; }
    .wm-author-profile { flex-direction: column; }
}

/* ---- アーカイブページ ---- */
.wm-archive-page { padding: 40px 0 80px; }

.wm-archive-title { font-size: 1.8rem; font-weight: 700; margin: 0 0 28px; }

.wm-archive-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
}

.wm-archive-tab {
    padding: 6px 20px;
    border-radius: 20px;
    border: 2px solid var(--primary-color, #2c5f8d);
    color: var(--primary-color, #2c5f8d);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition: background .15s, color .15s;
}

.wm-archive-tab:hover,
.wm-archive-tab.active { background: var(--primary-color, #2c5f8d); color: #fff; }

.wm-archive-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
}

.wm-archive-search-input {
    flex: 1 1 280px;
    max-width: 420px;
    padding: 9px 16px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: .9rem;
}

.wm-archive-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #2c5f8d);
}

.wm-archive-search-submit {
    padding: 8px 24px;
    border: none;
    border-radius: 20px;
    background: var(--primary-color, #2c5f8d);
    color: #fff;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}

.wm-archive-search-submit:hover { opacity: .85; }

.wm-archive-search-clear {
    font-size: .82rem;
    color: #888;
    text-decoration: underline;
}

.wm-archive-search-result-count { font-size: .9rem; color: #666; margin: 0 0 20px; }

.wm-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 900px) { .wm-archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .wm-archive-grid { grid-template-columns: 1fr; } }

.wm-archive-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}

.wm-archive-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }

.wm-archive-card-thumb     { display: block; overflow: hidden; }
.wm-archive-card-thumb img { width: 100%; height: 180px; object-fit: cover; display: block; transition: opacity .2s; }
.wm-archive-card-thumb:hover img { opacity: .85; }

.wm-archive-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wm-archive-card-cat {
    display: inline-block;
    background: var(--secondary-color, #f59e42);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    align-self: flex-start;
}

.wm-archive-card-title { font-size: .98rem; font-weight: 600; line-height: 1.5; margin: 0 0 8px; }
.wm-archive-card-title a { color: inherit; text-decoration: none; }
.wm-archive-card-title a:hover { color: var(--primary-color, #2c5f8d); }

.wm-archive-card-date    { font-size: .8rem; color: #999; margin: 0 0 8px; }
.wm-archive-card-summary { font-size: .88rem; color: #666; line-height: 1.65; margin: 0; }
.wm-no-posts             { grid-column: 1/-1; text-align: center; color: #888; padding: 40px 0; }

/* ---- タクソノミーアーカイブ ---- */
.wm-taxonomy-page   { padding: 40px 0 80px; }
.wm-taxonomy-header { margin-bottom: 28px; }
.wm-taxonomy-label  { font-size: .85rem; color: #888; }
.wm-taxonomy-heading { font-size: 1.6rem; font-weight: 700; margin: 0 0 4px; color: var(--primary-color, #2c5f8d); }
.wm-taxonomy-count  { color: #888; font-size: .9rem; margin: 0; }

/* ============================================================ */

/* Search Form Styles */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 20px 0;
}

.search-form label {
    flex: 1;
    margin: 0;
}

.search-field {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 95, 141, 0.1);
}

.search-submit {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Entry Content Styles */
.entry-header {
    margin-bottom: 30px;
}

.entry-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.entry-title a {
    color: var(--primary-color);
}

.entry-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.posted-on {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cat-links a {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-right: 5px;
}

.post-thumbnail {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.entry-content {
    margin-bottom: 40px;
    line-height: 1.9;
}

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.entry-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 30px 0 15px;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 10px;
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.entry-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.tag-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-links a {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag-links a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Posts Navigation */
.post-navigation,
.posts-navigation,
.posts-pagination,
.pagination {
    margin: 50px 0;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* ページネーション用（前後ナビとは別設定） */
.pagination .nav-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    margin: 0;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-color, #333);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.pagination .page-numbers:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
    min-width: 24px;
    padding: 0;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    padding: 0 16px;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-subtitle {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.nav-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.page-numbers:hover,
.page-numbers.current {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Archive Styles */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

/* Error 404 Styles */
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 .page-title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-404 .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.error-404 .widget {
    margin-top: 40px;
    text-align: left;
}

.error-404 .widget ul {
    list-style: none;
}

.error-404 .widget li {
    margin-bottom: 10px;
}

.error-404 .widget a {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Search Results */
.search-results article {
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.search-results article:last-child {
    border-bottom: none;
}

/* Page Links */
.page-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.page-links a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background-color: var(--bg-color);
    color: var(--primary-color);
    border-radius: 4px;
}

/* Accordion Styles */
.accordion-header {
    cursor: pointer;
    padding: 15px 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.accordion-header:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.accordion-header.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

/* Fixed Request Button Animation */
.fixed-request-button {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

/* Loading Animation は削除（白いフラッシュの原因のため） */

/* Print Styles */
@media print {
    .site-header,
    .breadcrumb,
    .site-footer,
    .fixed-request-button,
    .nav-links {
        display: none;
    }
}

/* Additional Responsive Styles */
@media (max-width: 1023px) {
    .entry-title {
        font-size: 1.75rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 767px) {
    .entry-title {
        font-size: 1.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .error-404 .page-title {
        font-size: 2.5rem;
    }
    
    .entry-content h2 {
        font-size: 1.5rem;
    }
    
    .entry-content h3 {
        font-size: 1.25rem;
    }
    
    .nav-links {
        flex-direction: column;
    }

    /* ページネーションはスマホでも横一列 */
    .pagination .nav-links {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
        padding-bottom: 4px;
        gap: 4px;
    }

    .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        flex-shrink: 0;
        font-size: 0.85rem;
    }

    .search-form {
        flex-direction: column;
    }
    
    .search-submit {
        width: 100%;
        border-radius: 25px;
    }
}

/* ========================================
   セクション見出しポップアニメーション
======================================== */

/* デフォルト：position基点のみ設定 */
.section-title {
    position: relative;
}

/* JSなし環境では::before/::afterを非表示 */
.section-title::before,
.section-title::after {
    content: none;
}

/* JS付与クラス：アニメーション待機 */
.section-title.will-animate {
    opacity: 0;
    transform: translateY(30px) scale(0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* アニメーション実行 */
.section-title.is-animated {
    animation: titleBounceIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

/* キャラクター装飾：左右共通ベーススタイル（flexアイテムとして配置） */
.section-title.will-animate::before,
.section-title.will-animate::after,
.section-title.is-animated::before,
.section-title.is-animated::after {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.45s ease 0.5s,
                transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s;
}

/* アニメーション完了後に表示 */
.section-title.is-animated::before,
.section-title.is-animated::after {
    opacity: 1;
    transform: scale(1);
}

/* 左キャラクター（デフォルト：としお） */
.section-title.will-animate::before,
.section-title.is-animated::before {
    background-image: url('../images/toshio1.png');
}

/* 右キャラクター（デフォルト：アンジェラ） */
.section-title.will-animate::after,
.section-title.is-animated::after {
    background-image: url('../images/angela1.png');
}

/* 教材ラインナップ：としお2＋アンジェラ2 */
#materials-heading.will-animate::before,
#materials-heading.is-animated::before {
    background-image: url('../images/toshio2.png');
}
#materials-heading.will-animate::after,
#materials-heading.is-animated::after {
    background-image: url('../images/angela2.png');
}

/* お客様の声：アンジェラ2＋けい */
#testimonials-heading.will-animate::before,
#testimonials-heading.is-animated::before {
    background-image: url('../images/angela2.png');
}
#testimonials-heading.will-animate::after,
#testimonials-heading.is-animated::after {
    background-image: url('../images/kei1.png');
}

/* おすすめ書籍：としお2＋けい */
#books-heading.will-animate::before,
#books-heading.is-animated::before {
    background-image: url('../images/toshio2.png');
}
#books-heading.will-animate::after,
#books-heading.is-animated::after {
    background-image: url('../images/kei1.png');
}

/* タブレット：キャラクターをやや小さく */
@media (max-width: 768px) {
    .section-title.will-animate::before,
    .section-title.will-animate::after,
    .section-title.is-animated::before,
    .section-title.is-animated::after {
        width: 48px;
        height: 48px;
    }
}

/* 極小画面ではキャラクター非表示 */
@media (max-width: 420px) {
    .section-title.will-animate::before,
    .section-title.will-animate::after,
    .section-title.is-animated::before,
    .section-title.is-animated::after {
        display: none;
    }
}

@keyframes titleBounceIn {
    0%   { opacity: 0; transform: translateY(30px) scale(0.88); }
    55%  { opacity: 1; transform: translateY(-7px) scale(1.05); }
    75%  { transform: translateY(3px) scale(0.98); }
    90%  { transform: translateY(-2px) scale(1.01); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* アニメーション軽減設定を尊重 */
@media (prefers-reduced-motion: reduce) {
    .section-title.will-animate {
        opacity: 1;
        transform: none;
    }
    .section-title.is-animated {
        animation: none;
    }
    .section-title.is-animated::before,
    .section-title.is-animated::after {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        transition: none;
    }
}

/* お知らせ見出しは既存の下罫線があるためキャラクター装飾なし */
#news-heading.will-animate::before,
#news-heading.will-animate::after,
#news-heading.is-animated::before,
#news-heading.is-animated::after {
    content: none;
}

/* ========================================
   ヒーロー賞バッジ
======================================== */

.hero-badges {
    position: absolute;
    bottom: 28px;
    right: 40px;
    display: grid;
    grid-template-columns: repeat(2, 92px);
    gap: 10px;
    z-index: 10;
}

.hero-badge {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2.5px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    padding: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 内側の装飾リング */
.hero-badge::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.hero-badge:hover {
    transform: scale(1.07) rotate(-2deg);
    box-shadow: 0 6px 20px rgba(160, 120, 0, 0.55);
}

/* 金色 */
.hero-badge {
    background: #c9a227;
    border: 2.5px solid rgba(255, 235, 100, 0.8);
    box-shadow: 0 4px 14px rgba(160, 120, 0, 0.4);
}

.hero-badge::before {
    border-color: rgba(255, 235, 100, 0.55);
}

.hero-badge-main {
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.hero-badge-sub {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    margin-top: 3px;
}

/* タブレット・スマホ：バッジを小さく */
@media (max-width: 900px) {
    .hero-badges {
        right: 16px;
        bottom: 16px;
        grid-template-columns: repeat(2, 76px);
        gap: 8px;
    }
    .hero-badge {
        width: 76px;
        height: 76px;
    }
    .hero-badge-main { font-size: 0.68rem; }
    .hero-badge-sub  { font-size: 0.55rem; }
}

/* 極小スクリーン：バッジを小さく調整して表示 */
@media (max-width: 480px) {
    .hero-badges {
        right: 8px;
        bottom: 10px;
        grid-template-columns: repeat(2, 58px);
        gap: 6px;
    }
    .hero-badge {
        width: 58px;
        height: 58px;
        padding: 5px;
    }
    .hero-badge-main { font-size: 0.55rem; }
    .hero-badge-sub  { font-size: 0.44rem; }
}

/* ========================================
   パルキッズとは：4色ポップカードデザイン
======================================== */

/* カードベース上書き */
.about-simple-item {
    border-radius: 20px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* 4色割り当て */
.about-simple-item:nth-child(1) { background: #2c5f8d; }
.about-simple-item:nth-child(2) { background: #e07b1c; }
.about-simple-item:nth-child(3) { background: #c94a2d; }
.about-simple-item:nth-child(4) { background: #2e8a5e; }

/* ホバー：浮き上がり */
.about-simple-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 0 rgba(0, 0, 0, 0.1);
}

/* 数字バッジ：白丸＋各色の数字 */
.about-simple-item .about-simple-number {
    background: #fff;
    width: 52px;
    height: 52px;
    font-size: 1.15rem;
}
.about-simple-item:nth-child(1) .about-simple-number { color: #2c5f8d; }
.about-simple-item:nth-child(2) .about-simple-number { color: #e07b1c; }
.about-simple-item:nth-child(3) .about-simple-number { color: #c94a2d; }
.about-simple-item:nth-child(4) .about-simple-number { color: #2e8a5e; }

/* テキストを白に */
.about-simple-item h3,
.about-simple-item p {
    color: #fff;
}

.about-simple-item p {
    opacity: 0.92;
}

/* ========================================
   はじめての方へ（ぴったり教材診断）
======================================== */
.sagasu-section {
    background: #fffbef;
}

/* スタートボタンエリア */
.sagasu-start-wrap {
    text-align: center;
    padding: 32px 20px;
}
.sagasu-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 48px;
    font-size: 1.15rem;
    font-weight: 700;
    font-family: inherit;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(44, 95, 141, 0.35);
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.sagasu-start-btn::after {
    content: '▶';
    font-size: 0.9em;
}
.sagasu-start-btn:hover {
    background: #1a3f60;
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(44, 95, 141, 0.4);
}
.sagasu-start-sub {
    margin-top: 12px;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* 質問ボックス */
.sagasu-question {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px 28px;
    margin: 24px auto;
    max-width: 860px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    position: relative;
}
.sagasu-q-badge {
    display: inline-block;
    position: absolute;
    top: -14px;
    left: 28px;
    padding: 4px 16px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.05em;
}
.sagasu-q-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* 選択肢ボタン（年齢・英検） */
.sagasu-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.sagasu-choice-btn {
    padding: 12px 20px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
}
.sagasu-choice-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* YES / NO ボタン */
.sagasu-yn-grid {
    display: flex;
    gap: 16px;
}
.sagasu-yn-btn {
    flex: 1;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    max-width: 200px;
}
.sagasu-yn-yes {
    background: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(44, 95, 141, 0.25);
}
.sagasu-yn-yes:hover {
    background: #1a3f60;
    border-color: #1a3f60;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(44, 95, 141, 0.35);
}
.sagasu-yn-no {
    background: #fff;
    color: var(--text-light);
    border: 2px solid var(--border-color);
}
.sagasu-yn-no:hover {
    background: var(--bg-color);
    border-color: #aaa;
    transform: translateY(-2px);
}

/* 結果エリア */
.sagasu-result {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    margin: 24px auto;
    max-width: 860px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    border-top: 4px solid var(--secondary-color);
}
.sagasu-result-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}
.sagasu-result-count {
    display: inline-block;
    background: var(--secondary-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    margin-bottom: 10px;
}
.sagasu-result-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* コメントブロック */
.sagasu-comment-block {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sagasu-comment-item p {
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--text-color);
    margin: 8px 0 0;
}
.sagasu-tag {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

/* 商品カードグリッド */
.sagasu-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 個別カード */
.sagasu-product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s, transform 0.25s;
}
.sagasu-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.sagasu-product-card--sub {
    border-color: #e8e0d5;
    background: #fdfcfa;
}

/* オススメバッジ */
.sagasu-rec-badge {
    display: block;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 20px;
    letter-spacing: 0.04em;
}
.sagasu-rec-badge--2 { background: var(--secondary-color); }
.sagasu-rec-badge--3 { background: var(--text-light); }
.sagasu-rec-badge--sub {
    background: var(--bg-color);
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

/* カード内レイアウト */
.sagasu-product-inner {
    display: flex;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
}
.sagasu-product-img {
    flex: 0 0 110px;
    display: block;
}
.sagasu-product-img img {
    width: 110px;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
    background: #f8f8f8;
}
.sagasu-product-body {
    flex: 1;
    min-width: 0;
}
.sagasu-product-name {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.5;
}
.sagasu-product-name a {
    color: var(--primary-color);
    text-decoration: none;
}
.sagasu-product-name a:hover { text-decoration: underline; }

.sagasu-price-regular {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 4px;
}
.sagasu-price-member {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 14px;
}

/* 詳細ボタン（既存 .btn-material-detail を継承 + 幅調整） */
.sagasu-detail-btn {
    display: inline-block;
    width: auto;
    padding: 9px 24px;
}

/* 注釈 */
.sagasu-note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 20px;
    line-height: 1.7;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}
.sagasu-note a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 相談掲示板ボタン */
.sagasu-consult-wrap {
    text-align: center;
    margin: 40px auto 0;
    max-width: 560px;
    padding: 32px 24px;
    background: #fff;
    border-radius: 16px;
    border: 2px dashed var(--border-color);
}
.sagasu-consult-lead {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0 0 16px;
    line-height: 1.7;
}
.btn-sagasu-consult {
    display: inline-block;
    padding: 14px 36px;
    background: var(--secondary-color);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(245, 158, 66, 0.4);
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
}
.btn-sagasu-consult:hover {
    background: #d4842a;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(245, 158, 66, 0.5);
}

/* レスポンシブ */
@media (max-width: 768px) {
    .sagasu-question,
    .sagasu-result {
        padding: 28px 18px 20px;
        border-radius: 12px;
    }
    .sagasu-choice-grid { flex-direction: column; }
    .sagasu-choice-btn  { min-width: unset; width: 100%; }
    .sagasu-yn-grid     { gap: 10px; }
    .sagasu-yn-btn      { max-width: none; font-size: 1rem; }
    .sagasu-product-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }
    .sagasu-product-img { flex: none; }
    .sagasu-product-img img { width: 140px; margin: 0 auto; }
    .sagasu-start-btn {
        font-size: 1rem;
        padding: 16px 32px;
    }
}

/* ========================================
   コンセプトナビゲーションセクション
======================================== */
.concept-nav-section {
    background: linear-gradient(135deg, #f0f5fb 0%, #faf7f2 60%, #f0f7f3 100%);
}

.concept-nav-headline {
    text-align: center;
    margin-bottom: 52px;
}

.concept-nav-eyebrow {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--primary-color, #2c5f8d);
    background: rgba(44,95,141,.08);
    padding: 4px 16px;
    border-radius: 20px;
    margin: 0 0 16px;
}

.concept-nav-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.55;
    color: #222;
    margin: 0 0 16px;
}

.concept-nav-accent {
    color: var(--primary-color, #2c5f8d);
    position: relative;
    display: inline-block;
}
.concept-nav-accent::after {
    content: '';
    position: absolute;
    left: 0; bottom: -3px;
    width: 0; height: 3px;
    background: var(--secondary-color, #f59e42);
    border-radius: 2px;
    transition: width .9s cubic-bezier(.22,1,.36,1) .4s;
}
.concept-nav-section.is-visible .concept-nav-accent::after { width: 100%; }

.concept-nav-lead {
    font-size: .98rem;
    color: #666;
    line-height: 1.85;
    margin: 0;
}

/* グリッド */
.concept-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}
@media (max-width: 1024px) { .concept-nav-grid { grid-template-columns: repeat(2, 1fr); } }

/* カード - 底面カラーシャドウによるポップ立体デザイン */
.concept-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border-radius: 20px;
    padding: 36px 22px 28px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 6px 0 var(--card-color, #2c5f8d), 0 10px 28px rgba(0,0,0,.10);
    position: relative;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}

/* 背景装飾サークル */
.concept-nav-card::before {
    content: '';
    position: absolute;
    top: -48px; right: -48px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: var(--card-color, #2c5f8d);
    opacity: .06;
    transition: transform .4s ease;
    pointer-events: none;
}
.concept-nav-card:hover::before { transform: scale(1.5); }
.concept-nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 var(--card-color, #2c5f8d), 0 16px 36px rgba(0,0,0,.14);
}

/* 入場アニメーション（JSが has-animation を付与したときのみ適用） */
.concept-nav-section.has-animation .concept-nav-card {
    opacity: 0;
    transform: translateY(44px);
    transition: opacity .55s ease, transform .55s ease, box-shadow .25s ease;
}
.concept-nav-section.has-animation .concept-nav-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0s; /* hover 時に遅延をリセット */
}
.concept-nav-section.has-animation .concept-nav-card.is-visible:hover {
    transform: translateY(-4px);
}
/* 入場前だけ stagger delay を適用 */
.concept-nav-section.has-animation .concept-nav-card:not(.is-visible):nth-child(1) { transition-delay: 0s;   }
.concept-nav-section.has-animation .concept-nav-card:not(.is-visible):nth-child(2) { transition-delay: .12s; }
.concept-nav-section.has-animation .concept-nav-card:not(.is-visible):nth-child(3) { transition-delay: .24s; }
.concept-nav-section.has-animation .concept-nav-card:not(.is-visible):nth-child(4) { transition-delay: .36s; }

/* 番号バッジ */
.concept-nav-card-num {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--card-color, #2c5f8d);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    flex-shrink: 0;
    animation: conceptNumFloat 3.2s ease-in-out infinite;
}
.concept-nav-card:nth-child(2) .concept-nav-card-num { animation-delay: .6s; }
.concept-nav-card:nth-child(3) .concept-nav-card-num { animation-delay: 1.2s; }
.concept-nav-card:nth-child(4) .concept-nav-card-num { animation-delay: 1.8s; }

@keyframes conceptNumFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.concept-nav-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--card-color, #2c5f8d);
    margin: 0 0 10px;
    line-height: 1.55;
}

.concept-nav-card-desc {
    font-size: .86rem;
    color: #666;
    line-height: 1.75;
    margin: 0 0 20px;
    flex: 1;
}

.concept-nav-card-cta {
    display: inline-block;
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    background: var(--card-color, #2c5f8d);
    padding: 8px 22px;
    border-radius: 20px;
    margin-top: auto;
    transition: transform .2s ease;
}
.concept-nav-card:hover .concept-nav-card-cta { transform: translateX(4px); }

@media (max-width: 767px) {
    .concept-nav-title { font-size: 1.45rem; }
    .concept-nav-card  { padding: 28px 18px 22px; }
    .concept-nav-card-num { width: 52px; height: 52px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .concept-nav-card-num { animation: none; }
    .concept-nav-section.has-animation .concept-nav-card {
        opacity: 1;
        transform: none;
        transition: box-shadow .25s;
    }
}

