/* ===== 下層ページ（読む・見る系）共通スタイル ===== */

/* --- ページヘッダー --- */
.page-header {
    padding: 80px 20px;
    text-align: center;
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    color: white;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin: 0 0 10px 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    color: white !important;
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
}

.page-header p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    opacity: 0.9;
    margin: 0;
    color: white !important;
}

/* --- 導入文とカテゴリボタン --- */
.portfolio-intro, .section .container > p {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 50px;
    line-height: 1.8;
}
.portfolio-categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}
.category-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary-color-start);
    background: transparent;
    color: var(--primary-color-start);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}
.category-btn:hover {
    background: var(--primary-color-start);
    color: white;
    transform: translateY(-2px);
}
.category-btn.active {
    background: var(--primary-color-start);
    color: white;
    border-color: var(--primary-color-start);
}

/* --- カードグリッドとカード本体 --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    align-items: stretch;
}
.portfolio-item, .course-item {
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.portfolio-item.hide {
    display: none;
}
.portfolio-card, .course-card {
    background: var(--bg-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.portfolio-card:hover, .course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px var(--shadow-dark);
}
.portfolio-image {
    width: 100%;
    padding-top: 56.25%; /* 16:9 アスペクト比 */
    position: relative;
    overflow: hidden;
}
.portfolio-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.portfolio-card:hover .portfolio-image img {
    transform: scale(1.05);
}
.portfolio-content, .course-content {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.portfolio-content h3, .course-content h3 {
    font-size: 1.3rem;
    margin: 0 0 10px 0;
    color: var(--text-dark);
    line-height: 1.4;
}
.portfolio-content p, .course-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0 0 25px 0;
    flex-grow: 1;
}
.portfolio-links, .course-links {
    margin-top: auto;
}
.portfolio-action-btn, .gallery-toggle-btn, .course-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(45deg, var(--primary-color-start), var(--primary-color-end));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.portfolio-action-btn:hover, .gallery-toggle-btn:hover, .course-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.portfolio-tags {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    background-color: var(--bg-light);
    color: var(--text-light);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}
/* サムネイルギャラリー & モーダル */
.thumbnail-gallery-wrapper { max-height: 0; overflow: hidden; transition: all 0.5s ease; padding: 0 25px; background: #f9f9f9; border-top: 1px solid #eee;}
.thumbnail-gallery-wrapper.open { max-height: 500px; padding: 20px 25px; margin-top: 20px;}
.thumbnail-gallery { display: flex; gap: 10px; overflow-x: auto;}
.thumbnail-img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: all 0.2s ease;}
.thumbnail-img:hover { transform: scale(1.05); box-shadow: 0 4px 15px rgba(0,0,0,0.2);}
.modal { display: none; position: fixed; z-index: 8000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); align-items: center; justify-content: center;}
.modal.show { display: flex; }
.modal-content { width: 90%; max-width: 1200px; height: 90vh; max-height: 800px; display: flex; position: relative;}
.close-btn { position: absolute; top: -10px; right: -10px; width: 40px; height: 40px; background: white; color: #333; border: none; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.3); z-index: 10;}
.modal-body { display: flex; gap: 25px; width: 100%; height: 100%; padding: 0;}
.modal-image-container { flex: 1 1 55%; display: flex; align-items: center; justify-content: center;}
#modal-image { max-width: 100%; max-height: 100%; object-fit: contain;}
.modal-info-container { flex: 1 1 45%; display: flex; flex-direction: column; overflow-y: auto; padding: 30px; background: #fff; border-radius: 0 10px 10px 0;}
#modal-title { margin: 0 0 10px 0; font-size: 1.8rem; font-weight: 600;}
#modal-description { line-height: 1.7; margin: 0 0 20px 0;}
.modal-divider { border: none; height: 1px; background: #ddd; margin: 15px 0;}
.prompt-box { background: #f5f7fa; padding: 15px; border-radius: 8px; margin: 10px 0; font-family: monospace; font-size: 0.9rem; line-height: 1.6; word-break: break-all;}
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.8); border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 1.5rem; cursor: pointer; transition: background 0.2s;}
.modal-nav:hover { background: white; }
#modal-prev { left: -70px; }
#modal-next { right: -70px; }

/* ===== 学習ページ専用スタイル ===== */
.step-container { margin-bottom: 80px; }
.step-title { font-size: 1.8rem; font-weight: 700; padding-bottom: 15px; border-bottom: 3px solid var(--primary-color-start); margin-bottom: 40px; display: inline-block; }
.course-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
@media (max-width: 768px) { .course-grid { grid-template-columns: 1fr; } }
.course-subtitle { font-weight: 600; font-style: italic; }
.learn-modal { display: none; position: fixed; z-index: 9000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); align-items: center; justify-content: center; }
.learn-modal.show { display: flex; }
.learn-modal-content { background-color: #fff; margin: auto; padding: 30px 40px; border-radius: 12px; width: 90%; max-width: 600px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.learn-modal-close-btn { color: #aaa; position: absolute; top: 10px; right: 20px; font-size: 28px; font-weight: bold; border: none; background: none; cursor: pointer; }
.learn-modal-close-btn:hover, .learn-modal-close-btn:focus { color: black; }
.learn-modal-content h2 { margin-top: 0; font-size: 1.8rem; }
.learn-modal-content p { font-size: 1.1rem; color: var(--text-light); background: var(--bg-light); padding: 15px; border-radius: 8px; }
.learn-modal-content h3 { margin-top: 30px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
.learn-modal-content ul { list-style-type: '📖'; padding-left: 20px; }
.learn-modal-content li { margin-bottom: 10px; padding-left: 10px; line-height: 1.6; }

/* ===== 記事ページ専用スタイル ===== */
.article-page { 
    background-color: #f8f9fa; /* ページの背景色 */
    padding-top: 70px; 
}
.article-main { 
    padding: 60px 20px; 
}
.article-container { 
    max-width: 800px; 
    margin: 0 auto; 
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}
.article-eyecatch { 
    margin-bottom: 30px; 
    border-radius: 8px; 
    overflow: hidden; 
}
.article-eyecatch img { 
    width: 100%; 
    height: auto; 
    display: block; 
}
.article-header h1 { 
    font-size: 2.2rem; 
    line-height: 1.5; 
    margin-bottom: 20px;
    font-weight: 700; 
}
.article-meta { 
    color: var(--text-light); 
    margin-bottom: 40px; 
    border-bottom: 1px solid #e2e8f0; 
    padding-bottom: 20px; 
    text-align: right; 
}
.article-content h2 { 
    font-size: 1.8rem; 
    margin-top: 50px; 
    margin-bottom: 20px; 
    border-bottom: 2px solid var(--primary-color-start); 
    padding-bottom: 10px; 
}
.article-content p { 
    font-size: 1.1rem; 
    line-height: 2.2; 
    margin-bottom: 30px; 
}
.article-footer { 
    margin-top: 60px; 
    padding-top: 30px; 
    border-top: 1px solid #e2e8f0; 
    text-align: center; 
}