body {
    font-family: "Noto Sans JP", sans-serif;
    background-color: #f5fbff;
    color: #111;
    margin: 0;
    padding: 0;
}

/* ===== リセット ===== */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* 横スクロール防止 */
} 

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 全画面の高さを保証 */
}
/* ページ全体の余白をなくす */
* {
    box-sizing: border-box;
}

.screen{
    display: flex;
    width: 100%;
}

.p-fv{
    width: 100%;
    height: 500px;
    background-image: url(../img/yusei1_sumrobo.webp);
    background-color:rgba(255, 255, 255, 0);
    background-blend-mode:lighten;
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}




/* ==========================================================================
    detail.html 本文スタイル
   ========================================================================== */

.detail-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.detail-content image {
    max-width: 60%;
    border-radius: 10px;
    margin-bottom: 20px;
}

.detail-content {
    white-space: pre-line;
    margin-top: 15px;
    line-height: 1.7;
}

.detail-content h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.detail-content h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 8px;
}

.detail-content p {
    margin: 10px 0;
    line-height: 1.7;
}

.detail-content ul {
    margin-left: 20px;
    list-style-type: disc;
}

.detail-content a {
    color: #006a9b;
    text-decoration: underline;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding: 0 10px;
}

.nav-button {
    color: #005f8f;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
}

.nav-button:hover {
    text-decoration: underline;
}

.back-button {
    margin-top: 30px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: #0b3c53;
    color: white;
    cursor: pointer;
}

.detail-gallery {
    /* flexを解除し、ラッパーを中央に配置 */
    display: block;
    text-align: center;
    margin-bottom: 20px;
    position: relative; /* 背景画像を絶対配置するための基準 */
}

.gallery-image-wrapper {
    display: inline-block; /* 画像ラッパーを中央に配置 */
    position: relative; /* ボタンとインジケーターの絶対配置の基準 */
    max-width: 100%; /* 親要素の幅を超えないように */
    overflow: hidden; /* ボタンを画像内に収めるため、overflow: hidden; を追加 */
    border-radius: 8px; /* 画像ラッパーにも角丸を適用 */
}

.gallery-image-wrapper.is-single .gallery-btn {
    display: none;
}


.gallery-main {
    width: 100%; /* ラッパーの幅いっぱいに広げる */
    height: auto;
    object-fit: contain;
    /* border-radius: 8px; を gallery-image-wrapper に移動 */
    display: block; /* インライン要素の隙間をなくす */
}

/* 画像を左右対称に中央揃えするための調整 */
.detail-gallery {
    display: flex;
    align-items: center;
    justify-content: center; /* これが中央揃えの核 */
    gap: 10px;
    margin-bottom: 20px;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;

    width: 42px;
    height: 42px;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.gallery-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: translateY(-50%) scale(1.08);
}

.gallery-btn:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    }


/* ボタンを画像内に配置 */
.gallery-btn.prev-btn {
    left: 5px; /* 画像の左端から5px内側 */
}

.gallery-btn.next-btn {
    right: 5px; /* 画像の右端から5px内側 */
}

/* SVGアイコンのスタイル */
.gallery-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2;
    fill: none;
}
.gallery-image-wrapper .gallery-btn {
    opacity: 0;
}

.gallery-image-wrapper:hover .gallery-btn {
    opacity: 1;
}


.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.post-tag {
    background-color: #cde7f8;
    color: #00334d;
    padding: 3px 8px;
    border-radius: 5px;
    margin-right: 0.3rem;
    font-size: 0.8em;
}

.post-tags span {
    background: #e0f4ff;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

/* ==========================================================================
    画像ギャラリー インジケーター スタイル
   ========================================================================== */

.detail-gallery {
    position: relative; /* インジケーターを絶対配置するための基準 */
}

.gallery-indicators {
    position: absolute;
    bottom: 10px; /* ギャラリー画像の下端から少し上に配置 */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px; /* 丸い印の間隔 */
    z-index: 10; /* ボタンより手前に表示 */
    /* gallery-image-wrapper内に移動したので、detail-galleryのflex設定は不要 */
}

.indicator-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5); /* 非アクティブな丸い印の色（半透明の白） */
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator-dot.active {
    background-color: #ffffff; /* アクティブな丸い印の色（白） */
}

/* ==========================================================================
    SNSシェアボタンのスタイル (detail.html)
   ========================================================================== */

.share-buttons-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 0 10px;
    justify-content: flex-end; /* 右寄せ */
}

.share-button {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
}

.share-button:hover {
    opacity: 0.8;
}

.share-icon{
    padding: 2px;
    width: 30px;
    height: 30px;
}

.share-button.twitter {
    background-color: #000; /* X Black */
    width: 30px;
    height: 30px;
}

.share-button.facebook {
    background-color: #0866ff; /* Facebook Blue */
    width: 30px;
    height: 30px;
}

.share-button.line {
    background-color: #00c300; /* LINE Green */
    width: 30px;
    height: 30px;
}

/* ==========================================================================
    Markdownテーブル（3カラムレイアウト）用スタイル
   ========================================================================== */

/* detail-content内のテーブル全体を対象とする */
#detail-content table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* カラム幅を均等にする */
    margin: 20px 0;
}

/* ヘッダー行（Markdownの記述例に合わせて非表示に） */
#detail-content thead {
    display: none;
}

/* セル（td）をコンテナとして扱う */
#detail-content td {
    padding: 10px;
    border: 1px solid #ddd; /* 四角いコンテナの枠線 */
    text-align: center; /* 文字を中央揃え */
    vertical-align: top; /* 画像を上部に寄せる */
    box-sizing: border-box;
}

/* 画像をセル内でレスポンシブかつ中央に配置 */
#detail-content td img {
    max-width: 100%;
    height: auto;
    display: block; /* 中央揃えのためにブロック要素化 */
    margin: 0 auto 10px auto; /* 下部に少し余白 */
}

/* 3カラム目を強制的に均等幅にするための調整 */
#detail-content tr:first-child td {
    width: 33.33%;
}

/* 2行目以降のテキスト行のセルにもスタイルを適用 */
#detail-content tr:nth-child(2) td {
    /* 画像の下の行のスタイル調整が必要であればここに記述 */
    font-weight: bold;
    color: #004457;
}


/* ===== スマホ対応 ===== */

/* ✅ 画面幅が 900px 以下のとき、縦並びへ切り替え */
@media (max-width: 900px) {
    .screen{
        flex-direction: column;
        width: 100%;
        gap: 20px;
    }

    .main{
        justify-content: center;
    }

    .sidebar{
        display: flex;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20px;
    }

    .tag-container{
        width: 250px;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .date-filter {
        flex: 1;
        display: flex;
        flex-direction: column; /* こちらも縦並び */
        gap: 10px;
        width: 250px;
    }

    .post-list {
        width: 100%;
    }

    .sidebar {
        position: static; /* sticky を解除して自然に流す */
    }

    .sort-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin: 20px 5%;
        max-width: 90%;
    }
    
    .sort-buttons {
        width: 100%;
        justify-content: space-around;
    }
    
    .sort-button {
        flex-grow: 1;
        text-align: center;
    }
}

/* ===== 小画面対応 =====*/
@media (max-width: 1000px) {
    .footer-content{
        flex-direction: column;
    }

    .footer-plot{
        grid-auto-flow: row;
        grid-template-columns: repeat(2, 1fr);  /* 2カラム */
        justify-items: center;
        gap: 30px 40px; 
    }
    
}

/* ===== スマホ対応 ===== */
@media (max-width: 768px) {

    .footer-plot{
        grid-template-columns: 1fr;  /* 1列にする */
        gap: 20px;
    }

    .gallery-image-wrapper .gallery-btn  {
    opacity: 1;
    }

    .detail-gallery {
        display: block;
        text-align: center;
    }

    .gallery-image-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    .gallery-main {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}


/* 小画面でのサイドバー調整 */
@media (max-width: 600px) {
    .sidebar {
        width: 100%;
        flex-direction: column !important;
    }
    
    .tag-container,
    .date-filter {
        width: 100% !important;
        max-width: 90%;
        margin: 0 5%;
    }
    
    .main{
        width: 100%;
    }
}
