/*
 * 「恐竜のしっぽ」サイト用スタイルシート
 * 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: 18px;
    -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);
}

/* 広告 */
.ad-container {
    margin: 20px auto;
    padding: 5px;
    background-color: var(--surface-color);
    border-radius: 8px;
    display: block;
    width: 100%;
    min-height: 280px;
    text-align: center;
}

/* 記事上部の広告 */
.ad-container-top {
    min-height: 250px;
}

/* 記事下の関連コンテンツ広告 */
.ad-container.autorelaxed-ad { 
    min-height: 300px;
}

.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-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;
    margin-left: 1.1rem;
    border-left: 3px solid var(--border-color);
    padding-left: 1.1em;
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}
.language-switcher a {
    color: var(--primary-color); 
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}
.language-switcher a:hover {
    color: var(--text-color); 
    background-color: #e9ecef;
}
.language-switcher a.active {
    color: var(--secondary-color);
    font-weight: 700;
    text-decoration: underline;
}
.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;
aspect-ratio: 1000 / 325;
}

.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: 1em 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 0.8em;
    font-size: 0.9em;
    color: var(--text-color); 
}

.content-figure-right {
    float: right;
    margin: 0 0 1em 10px;
    max-width: 50%;
}

.content-figure-left {
    float: left;
    margin: 0 10px 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-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    overflow: hidden;
}
.youtube-facade img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.3s ease;
}
.youtube-facade:hover img {
    transform: scale(1.05);
}
.youtube-facade::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
}
.youtube-facade:hover::before {
    background-color: rgba(0, 0, 0, 0);
}
.youtube-facade::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42-6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19 5.31 1.42 27.1 1.55 27.1 1.55s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
}
.youtube-facade:hover::after {
     transform: translate(-50%, -50%) scale(1.1);
}
/* --- ▲▲▲ 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.jpg');
    background-position: 95% 50%;
}
.content-section.bg-encyclopedia::before {
    background-image: url('./img/Triceratops_Gemini_Generated_Image.jpg');
    background-position: 5% 50%;
}
.content-section.bg-extinct::before {
    background-image: url('./img/Pteranodon_Gemini_Generated_Image.jpg');
    background-position: 95% 50%;
}
.content-section.bg-column::before {
    background-image: url('./img/Brachiosaurus_Gemini_Generated_Image.jpg');
    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;
    justify-content: center;
}

.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;
}


/* フッター */
.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-title {
    font-size: 1.1rem;
    color: #fff;
    font-weight: bold; /* <b>タグの代替 */
    margin-bottom: 1em; /* ulとの間隔を調整 */
}
.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);
    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);
}
.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}
.breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.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;
}
.interactive-gallery {
    margin: 2em auto;
    max-width: 800px;
}
.main-image-container {
    position: relative;
    width: 100%;
    padding-top: 75%; 
    background-color: #f4f6f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1em;
}
#gallery-main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; 
}
#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);
    }
    
    .ad-container {
        min-height: 50px;
        padding: 0;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .ad-container-top {
        min-height: 100px !important; 
        max-height: 100px; 
        padding: 0; 
        margin-top: 5px;
        margin-bottom: 10px;
        overflow: hidden; 
    }

    .ad-container.autorelaxed-ad {
        min-height: 300px !important;
        max-width: 728px; 
    }
    
    .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: 0.5em auto;
        max-width: 100%;
    }
}

