/*
 * 「恐竜のしっぽ」サイト用スタイルシート
 * 2025-07-19作成
 */

:root {
    --primary-color: #34495e; /* 深いスレートブルー */
    --secondary-color: #e67e22; /* キャロットオレンジ */
    --background-color: #f4f6f9; /* 明るいグレー */
    --surface-color: #ffffff; /* ホワイト */
    --text-color: #2c3e50; /* テキスト用の濃いブルーグレー */
    --text-color-muted: #7f8c8d; /* やや明るいグレー */
    --border-color: #e1e5ea;
    --header-height: 70px;
    --font-family-base: 'Inter', 'Noto Sans JP', sans-serif;
}

/* ▼▼▼ アニメーション定義 ▼▼▼ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-section {
    animation: fadeIn 0.8s ease-out forwards;
}
/* ▲▲▲ アニメーション定義 ▲▲▲ */


/* 基本的なリセットとページ全体のスタイル */
body {
    margin: 0;
    font-family: var(--font-family-base);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #d35400; /* 少し濃いオレンジ */
}

h1, h2, h3, h4 {
    margin: 0.8em 0 0.5em;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-color);
}

/* ヘッダーとナビゲーション */
.site-header {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.site-logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    margin-right: auto;
}

.main-nav {
    display: flex;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

.main-nav li {
    margin-left: 30px;
}

.main-nav a {
    text-decoration: none;
    font-weight: 700;
    padding: 5px 0;
    position: relative;
    color: var(--text-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

.header-utils {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}
.language-switcher a {
    color: var(--text-color-muted);
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.language-switcher a:hover {
    color: var(--secondary-color);
    background-color: #e9ecef;
}
.language-switcher a.active {
    color: var(--secondary-color);
    font-weight: 700;
}
.language-switcher span {
    color: var(--border-color);
}


/* ヒーローセクション */
.hero {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.hero::before {
    content: "";
    display: block;
    padding-top: 32.5%;
}

.hero-image,
.hero-overlay,
.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    object-fit: cover;
    z-index: 1;
}

.hero-overlay {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.2));
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3;
    color: #fff;
    padding: 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 0.2em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    color: #fff;
}
.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

/* メインコンテンツ */
.main-content {
    padding-top: 0;
}

/* --- ▼▼▼ 記事ページ用の追加スタイル ▼▼▼ --- */
.article-content {
    background-color: var(--surface-color);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content figure {
    margin: 2em 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 0.8em;
    font-size: 0.9em;
    color: var(--text-color-muted);
}

.content-figure-right {
    float: right;
    margin: 0 0 1em 2em;
    max-width: 50%;
}

.content-figure-left {
    float: left;
    margin: 0 2em 1em 0;
    max-width: 50%;
}

.clear-both {
    clear: both;
}

.img-bordered {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.fit-content {
    display: inline-block;
}

/* ★★★ 枠線付きの補足情報ボックス用のクラスを追加 ★★★ */
.info-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5em 1em;
    margin: 1em 1em;
    background-color: #f8f9fa;
}
/* --- ▲▲▲ 記事ページ用の追加スタイル ▲▲▲ --- */


/* --- ▼▼▼ テーブル用のスタイル ▼▼▼ --- */
.table-container {
    overflow-x: auto;
    margin: 2em 0;
}
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
}
th, td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}
th {
    background-color: #f8f9fa;
    font-weight: 700;
}
tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}
/* --- ▲▲▲ テーブル用のスタイル ▲▲▲ --- */

/* ★★★ テーブル用のスタイルを追加 ★★★ */
.table-bordered {
    width: 100%;
    max-width: 950px; 
    margin: 2em auto; 
    border-collapse: collapse; 
    background-color: var(--surface-color); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    font-size: 0.95rem;
}
.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color); 
    padding: 12px 15px; 
    text-align: left;
}
.table-bordered th {
    background-color: #f8f9fa;
    font-weight: 700;
}
/* ★★★ テーブル用のスタイルを追加 ▲▲▲ */



/* --- ▼▼▼ YouTube埋め込み用のスタイル ▼▼▼ --- */
.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 アスペクト比 */
    height: 0;
    overflow: hidden;
    margin: 2em 0;
}
.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
/* --- ▲▲▲ YouTube埋め込み用のスタイル ▲▲▲ --- */


.intro-section {
    text-align: center;
    font-size: 1.1rem;
    max-width: 800px;
    margin: 60px auto;
    color: var(--text-color-muted);
}

/* コンテンツセクション背景画像 */
.content-section {
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
    padding: 40px;
    border-radius: 12px;
    background-color: var(--surface-color);
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.03;
    z-index: 1;
}

.section-title,
.card-container,
.intro-section,
.section-title-sub, 
.article-list,
.article-list-columns,
.dino-list-container {
    position: relative;
    z-index: 2;
}

.content-section.bg-study::before {
    background-image: url('./img/Tyrannosaurus_Gemini_Generated_Image.png');
    background-position: 95% 50%;
}
.content-section.bg-encyclopedia::before {
    background-image: url('./img/Triceratops_Gemini_Generated_Image.png');
    background-position: 5% 50%;
}
.content-section.bg-extinct::before {
    background-image: url('./img/Pteranodon_Gemini_Generated_Image.png');
    background-position: 95% 50%;
}
.content-section.bg-column::before {
    background-image: url('./img/Brachiosaurus_Gemini_Generated_Image.png');
    background-position: 5% 50%;
}


.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

/* カードレイアウト */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.1);
    border-color: var(--secondary-color);
}

.card-title {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}
.card ul {
    padding-left: 20px;
    flex-grow: 1;
    color: var(--text-color-muted);
}
.card li {
    margin-bottom: 8px;
}
.card p {
    flex-grow: 1;
    color: var(--text-color-muted);
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    align-self: flex-end;
    margin-top: 15px;
    border: none;
    transition: all 0.3s ease;
}
.btn:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.2);
    color: #fff;
}

/* 広告 */
.ad-container {
    margin: 40px auto;
    padding: 20px;
    background-color: var(--surface-color);
    border-radius: 8px;
    display: block;
    width: 100%;
    min-height: 100px;
    text-align: center;
}

.ad-card {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}
.ad-card ins {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* フッター */
.site-footer {
    background-color: var(--primary-color);
    padding-top: 40px;
    margin-top: 50px;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
    color: #bdc3c7;
    font-size: 0.9rem;
}
.footer-nav-column h4 {
    color: #fff;
    font-size: 1.1rem;
}
.footer-nav-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-nav-column li {
    margin-bottom: 10px;
}
.footer-nav-column a {
    color: #bdc3c7;
}
.footer-nav-column a:hover {
    color: #fff;
}
.copyright {
    background-color: #fff;
    padding: 20px 0;
    text-align: center;
    color: var(--text-color-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}
.copyright p {
    margin: 0;
}
.copyright img {
    margin: 10px auto 0;
}


/* モバイルナビゲーション */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}
.mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* 下層ページ用スタイル */
.breadcrumbs {
    margin-bottom: 30px;
    font-size: 0.9rem;
    color: var(--text-color-muted);
}
.breadcrumbs a {
    color: var(--primary-color);
}

.section-title-sub {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
}
.section-title-sub .sub-eng-title .section-title-sub2{
    font-size: 1rem;
    color: var(--text-color-muted);
    margin-left: 10px;
}

.section-title-sub2 {
    font-size: 1.4rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* ★★★ 関連ページセクション用のスタイルを追加 ★★★ */
.related-links-section {
    margin-top: 50px;
}
.related-links-list {
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}
.related-links-list li {
    flex: 1 1 200px;
}
.related-links-list a {
    display: block;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
    transition: all 0.3s ease;
}
.related-links-list a:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.article-list, .article-list-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.article-card, .article-card-simple {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    overflow: hidden;
}
.article-card:hover, .article-card-simple:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.1);
}
.article-card-image {
    width: 100%;
    height: 150px; 
    object-fit: cover;
}
.article-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.article-card-content h3 {
    font-size: 1.25rem;
    margin-top: 0;
}
.article-card-content p {
    flex-grow: 1;
    color: var(--text-color-muted);
    margin-bottom: 1.5em;
}
.card-link-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0;
    flex-grow: 1;
}
.card-link-list li {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.card-link-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.card-link-list a, .read-more-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.3s ease;
}
.card-link-list a:hover, .read-more-link:hover {
    color: var(--secondary-color);
}
.read-more-link {
    display: inline-block;
    margin-top: auto;
    padding-top: 10px;
    align-self: flex-end;
}

.link-card-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.dino-list-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.dino-list {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 1;
}
.dino-list li {
    margin-bottom: 12px;
}
.dino-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}
.dino-list a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ★★★ ギャラリーセクション用のスタイルを追加 ★★★ */
.gallery-flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.gallery-flex-container > figure {
    flex: 1;
    min-width: 250px;
    margin: 0; /* figureのデフォルトマージンをリセット */
}

        .interactive-gallery {
            margin: 2em auto;
            max-width: 800px;
        }
        .main-image-container {
            margin-bottom: 1em;
        }
        #gallery-main-image {
            width: 100%;
            height: auto;
            object-fit: cover;
        }
        #gallery-caption {
            margin-top: 0.8em;
            font-size: 0.9em;
            color: var(--text-color-muted);
            text-align: center;
        }
        .gallery-thumbnails {
            display: flex;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .gallery-thumb {
            width: 100px;
            height: 75px;
            object-fit: cover;
            cursor: pointer;
            border: 3px solid transparent;
            border-radius: 4px;
            transition: border-color 0.3s ease;
        }
        .gallery-thumb:hover {
            border-color: var(--secondary-color);
        }
        .gallery-thumb.active {
            border-color: var(--primary-color);
        }
        
/* ★★★ ギャラリーセクション用のスタイルを追加 ▲▲▲ */


/* レスポンシブデザイン */
@media (min-width: 640px) {
    .article-list, .article-list-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    .dino-list {
        column-count: 2; /* タブレットでは2列 */
    }
}

@media (min-width: 1024px) {
    .article-list, .article-list-columns {
        grid-template-columns: repeat(3, 1fr);
    }
    .dino-list {
        column-count: 3; /* PCでは3列 */
    }
}


@media (max-width: 880px) {
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        border-bottom: 1px solid var(--border-color);
    }
    .main-nav.active {
        display: flex;
    }
    .main-nav ul {
        flex-direction: column;
        width: 100%;
    }
    .main-nav li {
        margin: 0;
        text-align: center;
    }
    .main-nav a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    .main-nav a:hover {
        background-color: var(--surface-color);
    }
    .main-nav a::after {
        display: none;
    }

    .mobile-nav-toggle {
        display: block;
    }
    
    .mobile-nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .footer-nav {
        flex-direction: column;
    }
    
    .content-section::before {
        background-size: 150px;
        opacity: 0.08;
    }

    /* --- ▼▼▼ 記事ページ用の追加スタイル(レスポンシブ) ▼▼▼ --- */
    .article-content {
        padding: 20px;
    }
    .content-figure-right,
    .content-figure-left {
        float: none;
        margin: 2em auto;
        max-width: 80%;
    }
    /* --- ▲▲▲ 記事ページ用の追加スタイル(レスポンシブ) ▲▲▲ --- */

    /* ▼▼▼【変更】記事上部広告のモバイルでの表示調整 ▼▼▼ */
    .ad-container-top {
        min-height: 50px; /* 最小の高さを設定 */
        max-height: 100px; /* 最大の高さを100pxに制限 */
        padding: 0; /* 上下の余白をなくす */
        margin-top: 10px;
        margin-bottom: 10px;
        overflow: hidden; /* コンテナからはみ出した部分を非表示に */
    }
    /* もし完全に非表示にしたい場合は、こちらを有効にしてください */
    /*
    .ad-container-top {
        display: none;
    }
    */
    /* ▲▲▲【変更】記事上部広告のモバイルでの表示調整 ▲▲▲ */
}
