/*
Theme Name: Hayashi Tsuyoshi Professional Artist Theme
Author: Hayashi Tsuyoshi
Description: 俳優・林 剛史 公式サイト。SNS横並びボタン、3-2配置、JOURNAL明朝体。
Version: 9.5
*/

/* --- 全体設定 --- */
body { font-family: "Noto Sans JP", "Shippori Mincho", serif; line-height: 1.8; color: #1a1a1a; background: #fdfdfd; margin: 0; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none !important; color: inherit; transition: 0.3s ease; }
.serif { font-family: "Shippori Mincho", serif !important; font-weight: 700 !important; }

/* --- ヘッダー・メニュー --- */
header { background: #fff; border-bottom: 1px solid #eee; padding: 15px 0; position: sticky; top: 0; z-index: 9999; }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.header-logo h1 { margin: 0; font-size: 24px; font-weight: bold; color: #002b5e; }
nav#main-nav ul { display: flex; list-style: none; padding: 0; margin: 0; gap: 25px; }
nav#main-nav ul li a { font-weight: bold; color: #444; font-size: 14px; letter-spacing: 0.1em; }

#menu-toggle { display: none; cursor: pointer; width: 30px; height: 22px; position: relative; }
#menu-toggle span { position: absolute; width: 100%; height: 3px; background: #002b5e; border-radius: 3px; transition: 0.3s; }
#menu-toggle span:nth-child(1) { top: 0; }
#menu-toggle span:nth-child(2) { top: 10px; }
#menu-toggle span:nth-child(3) { top: 20px; }

/* --- メインビジュアル：フェードスライダーの設定 --- */
.hero-slider {
    width: 100%;
    height: 70vh; /* PCでの高さ（画面の70%） */
    min-height: 450px;
    max-height: 750px;
    position: relative;
    overflow: hidden;
    background: #000;
}

.slider-inner {
    width: 100%;
    height: 100%;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* 最初は透明 */
    transition: opacity 1.5s ease-in-out; /* 1.5秒かけてふわっと切り替わる */
    z-index: 1;
}

/* 表示されているスライドの設定 */
.slide-item.active {
    opacity: 1; /* 不透明にして表示 */
    z-index: 2;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像を枠に合わせる（切れない設定） */
    object-position: center top; /* 顔が切れにくいように上部優先 */
}

/* 画像の上に載せるテキスト */
.hero-overlay-text {
    position: absolute;
    bottom: 50px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    z-index: 10; /* 画像より上に配置 */
    text-shadow: 0 2px 15px rgba(0,0,0,0.6);
}

.hero-overlay-text h2 { font-size: 42px; margin: 0; letter-spacing: 0.2em; }
.hero-overlay-text p { font-size: 13px; letter-spacing: 0.5em; text-transform: uppercase; margin-top: 10px; opacity: 0.8; }

/* スマホ用調整 */
@media (max-width: 768px) {
    .hero-slider {
        height: 60vh; /* スマホでは少し縦長に */
        min-height: 350px;
    }
    .hero-overlay-text h2 { font-size: 28px; }
    .hero-overlay-text p { font-size: 10px; }
}

.main-visual-img {
    width: 100%;
    height: 70vh; /* PCでは画面の高さの70%にする（大きすぎを防止） */
    min-height: 400px;
    max-height: 700px; /* PCでの最大高さを制限 */
}

.main-visual-img img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠に合わせて綺麗に切り抜く */
    object-position: center top; /* 上端（顔など）を優先して表示 */
}

/* 画像の上の文字（不要なら消してもOK） */
.main-visual-text {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.main-visual-text h2 { font-size: 48px; margin: 0; letter-spacing: 0.2em; }
.main-visual-text p { font-size: 14px; letter-spacing: 0.4em; text-transform: uppercase; }

/* --- 流れる帯（header-sub-bar）を大きく調整 --- */
.header-sub-bar {
    padding: 20px 0; /* 余白を増やして太くする */
}
.slider-content img {
    height: 160px; /* 画像自体の高さを120pxから160pxへ大きく */
    margin-right: 20px;
}

/* --- スマホ専用設定 --- */
@media (max-width: 768px) {
    .main-visual-img {
        height: 60vh; /* スマホでは少し縦長に見せる */
        max-height: none;
    }
    .main-visual-text h2 { font-size: 28px; }
    
    .header-sub-bar { padding: 15px 0; }
    .slider-content img { height: 100px; } /* スマホでも少し大きく */
}

/* --- 流れる画像帯 --- */
.header-sub-bar { background: #001a3d; overflow: hidden; padding: 10px 0; width: 100%; position: relative; }
.slider-content { display: flex; animation: flow 40s linear infinite; }
@keyframes flow { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.slider-content img { height: 120px; width: auto; margin-right: 15px; object-fit: cover; border-radius: 2px; }


/* --- NEWS & BLOG --- */
.news-row { display: flex; gap: 20px; padding: 15px; background: #fff; border-bottom: 1px solid #eee; align-items: center; }
.news-thumb-box { flex: 0 0 120px; height: 80px; overflow: hidden; border-radius: 4px; }
.news-thumb-box img { width: 100%; height: 100%; object-fit: cover; }

.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 35px; margin-top: 30px; }
.blog-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); display: flex; flex-direction: column; height: 100%; }
.blog-img-box { width: 100%; height: 210px; overflow: hidden; }
.blog-img-box img { width: 100%; height: 100%; object-fit: cover; }
.blog-body { padding: 25px; flex-grow: 1; }

/* --- アーカイブタイトル --- */
.archive-header { text-align: center; margin: 60px 0 40px; border-bottom: 1px solid #eee; padding-bottom: 30px; }
.archive-main-title { font-size: 42px !important; color: #002b5e !important; letter-spacing: 0.15em !important; }
.archive-main-title .sub-text { display: block; font-size: 11px; letter-spacing: 0.3em; color: #aaa; margin-top: 10px; }

/* --- フッター --- */
.site-footer { background: #002b5e; color: rgba(255, 255, 255, 0.7); padding: 50px 0 30px; margin-top: 80px; text-align: center; }
.footer-sns { margin-bottom: 25px; }
.footer-sns a { color: #fff; font-size: 22px; margin: 0 12px; display: inline-block; }
.footer-copy { font-size: 10px; letter-spacing: 0.1em; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; margin-top: 20px; }

/* --- スマホ対応 --- */
@media (max-width: 768px) {
    #menu-toggle { display: block; }
    nav#main-nav { display: none; position: absolute; top: 60px; left: 0; width: 100%; background: #fff; box-shadow: 0 5px 10px rgba(0,0,0,0.1); }
    nav#main-nav.active { display: block; }
    nav#main-nav ul { flex-direction: column; }
    nav#main-nav ul li a { padding: 15px 20px; border-bottom: 1px solid #eee; }

    /* SNSをコンパクトな3-2並び・横長ボタン */
    .community-grid { 
        display: flex;
        justify-content: center;
        gap: 8px; 
    }
    .community-card { 
        width: calc(33.33% - 10px); /* 3つ並び */
        min-width: auto;
        padding: 10px 5px; 
        gap: 5px;
    }
    .sns-icon { font-size: 16px; }
    .community-name { font-size: 11px; }

    .blog-grid { grid-template-columns: 1fr; }
    .slider-content img { height: 80px; }
    .archive-main-title { font-size: 28px !important; }
}

.btn-more { display: inline-block; padding: 12px 35px; border: 1px solid #002b5e; color: #002b5e !important; border-radius: 4px; margin-top: 30px; font-weight: bold; font-size: 12px; }
.btn-more:hover { background: #002b5e; color: #fff !important; }
/* --- 記事下のナビゲーションデザイン --- */
.post-navigation {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 50px;
}

/* 左右それぞれのリンクボックス */
.nav-prev, .nav-next {
    width: 48%;
}
.nav-next { text-align: right; }

.nav-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #aaa;
    margin-bottom: 8px;
    font-weight: bold;
}

.nav-title {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #002b5e;
    line-height: 1.5;
    transition: 0.3s;
}

.nav-links a:hover .nav-title {
    color: #333;
}

/* 一覧へ戻るボタン */
.nav-archive-back {
    text-align: center;
}
.btn-back {
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #888;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    transition: 0.3s;
}
.btn-back:hover {
    color: #002b5e;
    border-color: #002b5e;
}

/* スマホ対応 */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 30px;
    }
    .nav-prev, .nav-next {
        width: 100%;
        text-align: center;
    }
}
/* --- 記事詳細ページのアイキャッチ画像設定 --- */
.post-eyecatch {
    width: 100%;
    margin-bottom: 30px;
    overflow: hidden; /* はみ出し防止 */
    border-radius: 4px; /* 他のデザインと統一 */
}

.post-eyecatch img {
    width: 100% !important; /* 横幅を親要素（画面）に合わせる */
    height: auto !important; /* 高さを画像本来の比率で自動計算（これで切れない） */
    display: block;
    margin: 0 auto;
}

/* 記事本文内の画像も同様に切れないように設定 */
.post-content img {
    max-width: 100% !important;
    height: auto !important;
}

/* --- スマホ専用の微調整 --- */
@media (max-width: 768px) {
    .post-detail {
        padding: 20px 0; /* スマホでは余白を少し詰める */
    }
    .post-detail h1 {
        font-size: 24px; /* スマホではタイトルを少し小さく */
        line-height: 1.4;
    }
    .post-eyecatch {
        margin-bottom: 20px;
    }
}


/* ==========================================================================
   2. ページネーション（数字のナビ）の修正
   ========================================================================== */
/* 枠全体の設定 */
.pagination, .navigation.pagination {
    text-align: center !important;
    margin: 60px 0 !important;
    width: 100% !important;
}

/* 数字を囲むリスト */
.nav-links {
    display: flex !important;
    justify-content: center !important; /* PCで中央に寄せる */
    flex-wrap: wrap !important; /* スマホで入り切らない時は折り返す */
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
}

/* 各数字（リンク）のデザイン */
.page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    background: #fff !important;
    border: 1px solid #eee !important;
    color: #002b5e !important;
    font-weight: bold !important;
    font-size: 14px !important;
    transition: 0.3s !important;
}

/* 現在のページ */
.page-numbers.current {
    background: #002b5e !important;
    color: #fff !important;
    border-color: #002b5e !important;
}

.page-numbers:hover:not(.current) {
    background: #f0f4f8 !important;
    border-color: #002b5e !important;
}

/* スマホでのページネーション調整 */
@media (max-width: 768px) {
    .page-numbers {
        min-width: 35px !important;
        height: 35px !important;
        font-size: 13px !important;
    }
}

/* --- レイアウトの基本（中央寄せを強制） --- */
.container {
    max-width: 1100px !important;
    margin: 0 auto !important; /* これでPCでも中央に来ます */
    padding: 0 20px;
}

.site-content {
    margin: 60px 0 100px;
}

.section-title {
    border-left: 5px solid #002b5e;
    padding-left: 15px;
    color: #002b5e;
    margin-bottom: 30px;
}

/* --- メインビジュアル：CSSフェードスライダーの設定 --- */
.main-slider {
    width: 100%;
    height: 75vh;
    min-height: 450px;
    max-height: 800px;
    position: relative;
    overflow: hidden;
    background: #000;
}
.slider-box { width: 100%; height: 100%; position: relative; }

.slide-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center top;
    opacity: 0; /* 最初は透明 */
    animation: fadeSlider 20s infinite; /* 20秒（5秒×4枚）でループ */
}

/* 4枚の表示タイミングを正確にずらす */
.slide-image:nth-child(1) { animation-delay: 0s; }
.slide-image:nth-child(2) { animation-delay: 5s; }
.slide-image:nth-child(3) { animation-delay: 10s; }
.slide-image:nth-child(4) { animation-delay: 15s; }

/* ふわっと切り替わるアニメーション */
@keyframes fadeSlider {
    0% { opacity: 0; }
    5% { opacity: 1; }
    25% { opacity: 1; }
    30% { opacity: 0; }
    100% { opacity: 0; }
}

.slider-overlay {
    position: absolute; bottom: 60px; left: 0; right: 0; text-align: center; color: #fff; z-index: 10;
    text-shadow: 0 2px 20px rgba(0,0,0,0.7); pointer-events: none;
}
.slider-overlay h2 { font-size: 48px; margin: 0; letter-spacing: 0.25em; }

/* --- NEWSリスト：PCでも中央に配置 --- */
.news-list-box {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}
.news-row { display: flex; gap: 25px; padding: 20px; border-bottom: 1px solid #eee; align-items: center; }
.news-thumb-box { flex: 0 0 130px; height: 85px; overflow: hidden; border-radius: 4px; }
.news-thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.news-title { font-weight: bold; font-size: 16px; color: #333; }

/* --- BLOGグリッド：PCで横に広がりすぎない設定 --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.blog-card {
    background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; height: 100%;
}
.blog-img-box { width: 100%; height: 210px; overflow: hidden; }
.blog-img-box img { width: 100%; height: 100%; object-fit: cover; }
.blog-body { padding: 25px; flex-grow: 1; }

.btn-center { text-align: center; margin-top: 40px; }

/* --- スマホ調整 --- */
@media (max-width: 768px) {
    .main-slider { height: 60vh; }
    .slider-overlay h2 { font-size: 32px; }
    .news-thumb-box { flex: 0 0 90px; height: 60px; }
    .blog-grid { grid-template-columns: 1fr; }
}