/* ========================================
   ストーリー一覧ページ
   ======================================== */

/* ページコンテナ */
.stories-page {
    margin: 0 auto;
    padding: 0 0 40px;
    max-width: 640px;
}

/* ========================================
   ストーリーリスト
   ======================================== */
.stories-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0px;
    border-radius: 8px;
}

/* ========================================
   ストーリーカード
   ======================================== */
.story-card {
    padding: 16px 8px;
    border-bottom: solid 1px #f0eff4;
    transition: background-color .2s;
}
.story__headerline-contentsWrap{
    display: flex;
    gap: 8px;
}

/*アバター画像*/
a.story-card__author {
    display: block;
}
.story-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #bfbfbf;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: hover .6s;
}
.story-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.story-card__avatar:hover{
    opacity: .8;
}



.story-card a.story_title-link{
    text-decoration:none;
}
.story-card a.story_title-link:hover{
    text-decoration: underline;
}
.story-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    transition: all .3s;
}
.story-card__link:hover img{
    transform: scale(1.05);
}

.story-card__date {
    font-size: 13px;
    display: flex;
    align-items: center;
    color: var(--fontgray);
}


.story-card__nicknametxt{
    text-decoration: none;
}




.story-card__nickname {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;     /* 1. 改行させない */
    overflow: hidden;        /* 2. はみ出た部分を隠す */
    text-overflow: ellipsis; /* 3. はみ出た部分を「...」にする */  
    max-width: 420px;
    display: inline-block;
    line-height: 1;
}

.story-card__contents-link{
    display: block;
    text-decoration: none;
    color: inherit;
}
.story-contents{
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}
.story---contents_textwrap .nickname-date_wrap{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.story-card__title {
    font-size: 16px;
    font-weight:600;
    margin-bottom:2px;
    line-height: 1.3;
    display: inline-block;
}
.story-card:has(.story-card__contents-link:hover) {
  background-color: #f6f3f6;
}
.story-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    overflow: hidden;
    border: solid 1px #ecebf2;
}
.story-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.story-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 40px;
}

.story-card__content {
    font-size: 14px;
    line-height: 1.4;
}

.story-card__actions {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 18px;
}
.story-card__actions img{
    width: 18px;
    height: 18px;
    opacity: .5;
}

.story-card__action-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    justify-content: center;
    text-decoration: none;
    color: #7e7580;
    position: relative;
}
.story-card__action-btn span.material-symbols-outlined{
    font-size: 20px;
    color: #8a848c;
}
.story-card__action-btn.is-liked span.material-symbols-outlined{
    color: var(--btncolor);
    font-variation-settings: 'FILL' 1;
}
.story-card__action-btn.is-liked::before,
.story-card__action-btn.is-liked::after{
    display: none;
}
.story-card__action-btn.is-liked span.material-symbols-outlined{
    font-variation-settings: 'FILL' 1;
}
.js-likes-count,
.js-comments-count{
    font-family: "Google Sans Flex", 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
    width: 17px;
    text-align: center;
}

/* ========================================
   空の状態
   ======================================== */
.stories-empty {
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

/* ========================================
   ページネーション
   ======================================== */
.stories-pagination {
    margin-top: 40px;
}

.stories-pagination .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* ========================================
   FAB投稿ボタン
   ======================================== */
.stories-fab {
    position: fixed;
    right: 24px;
    bottom: 22px;
    z-index: 100;
    transition: bottom 0.3s ease; 
}
.stories-fab.is-at-bottom {
    bottom: 66px;
}


/* ========================================
   ストーリー詳細ページ
   ======================================== */
.story-detail-page {
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   ストーリー詳細
   ======================================== */
.story-detail {
    padding: 24px 0 0;
}

.story-detail_wrapper{
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.story-detail__date {
    font-size: 14px;
    display: flex;
    align-items: center;
    line-height: 1;
    color: var(--fontgray);
}

.story-detail__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.story-detail__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.name---dataWrap{
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    width: 100%;
}
.story-detail__author {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.story-detail__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #bfbfbf;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-detail__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-detail__avatar .fa-user {
    color: #5c5c5c;
    font-size: 20px;
}

.story-detail__nickname {
    font-size: 15px;
    font-weight: 600;  
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    line-height: 1;
}

.story-detail__actions {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 24px;
    margin-bottom: 20px;
}

.story-detail__action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 20px;
    background: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #7e7580;
}
.story-detail__action-btn .material-symbols-outlined{
    color: #8a848c;
}

.story-detail__action-btn.is-liked .material-symbols-outlined{
font-variation-settings: 'FILL' 1;
color: var(--btncolor);
}
.story-detail__action-btn.is-liked.tooltip-btn::before,
.story-detail__action-btn.is-liked.tooltip-btn::after{
    display: none;
}
.story-detail__action-btn svg {
    flex-shrink: 0;
}

.story-detail__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #e8e8e8;
}

.story-detail__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-detail__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 40px;
}

.story-detail__content {
    margin-left: auto;
    margin-right: auto;
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* ========================================
   コメントセクション
   ======================================== */
.story-comments {
    margin-left: auto;
    margin-right: auto;
    scroll-margin-top: 150px;
}
.commentsTitle{
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}
.story-comments__form-actions {
    display: flex;
    justify-content: flex-end;
}
.story-comments__form-actions .btn-primary{
    padding: 0;
    width: 36px;
    height: 36px;
    background-color: #fff;
    border: 0;
    color: var(--btncolor);
}
.story-comments__form-actions .btn-primary:hover{
    background-color: #efefef;
}
.story-comments__form-actions .btn-primary .material-symbols-outlined{
    font-size: 22px;
}

/* ========================================
   コメントリスト
   ======================================== */
.story-comments__list {
    display: flex;
    flex-direction: column;
}

.story-comment {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding:0 0 10px;
    border-bottom: solid 1px #f0eff4;
}
.form-textarea.story__commentBox{
    border: solid 1px #ddd;
    background-color: #fff;
    padding: 12px;
    border-radius: 3px;
}
.form-textarea.story__commentBox::placeholder{
    color: #979497;
    font-size: 13px;
}
.story-comment__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f2f2f2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.story-comment__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-comment__avatar .fa-user {
    color: #5c5c5c;
    font-size: 16px;
}

.story-comment__body {
    flex: 1;
    min-width: 0;
}

.story-comment__nickname {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 2px;
}

.story-comment__content {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 8px;
    color: var(--fontcolor2);
}

.story-comment__like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: none;
    font-size: 13px;
    color: #8a848c;
    cursor: pointer;
}

.story-comment__like-btn:hover {
    color: #e74c3c;
}
.story-comment__like-btn .material-symbols-outlined{
    font-size: 15px;
}
.story-comment__like-btn.is-liked,
.story-comment__like-btn.is-liked .material-symbols-outlined{
    font-variation-settings: 'FILL' 1;
    color: #e74c3c;
}

.story-comment__like-btn svg {
    flex-shrink: 0;
}

.story-comment__content--hidden {
    color: #999;
    font-style: italic;
}

/* ========================================
   レスポンシブ対応
   ======================================== */
@media (max-width: 768px) {
    .stories-list{
        padding: 0px;
        overflow: hidden;
    }
    .stories-page,
    .story-detail-page {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
    .story-card{
        padding: 12px 0;
        margin-bottom: 6px;
    }
    .story-card__nickname{
        width: calc(100vw - 174px);
        font-size: 14px;
        line-height: 1;
    }
    .story-card__link{
        margin-left: 0;
        padding: 0;
    }
    .story-contents{
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: -8px;
        padding-left: 36px;
    }
    .story-card__avatar {
        width: 28px;
        height: 28px;
    }
    .story-headerline .user-data {
        gap: 8px;
    }
    .story-card__nicknametxt{
        white-space: nowrap;     /* 文字を途中で改行させない */
        overflow: hidden;        /* 枠からはみ出た部分を非表示にする */
        text-overflow: ellipsis;
    }
    .story-card__title {
        font-size: 15px;
    }
    .story-card__action-btn{
        width: auto;
        font-size: 13px;
    }
    .story-card__content{
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 14px;
    }
    .stories-fab{
        right: 8px;
        bottom: 90px;
    }
    .stories-fab.is-at-bottom{
        bottom: 86px;
    }
    .fab-post-btn{
        width: 56px;
        height: 56px;
        border-radius: 36px;
        padding: 0;
        box-shadow: 3px 3px 7px 0px rgba(0, 0, 0, 0.23);
    }
    .fab-post-btn__text{
        display: none;
    }
    .story-detail__title{
        font-size: 19px;
    }
    .story-detail__avatar{
        width: 32px;
        height: 32px;
    }
    .story-detail__date{
        font-size: 12px;
    }
    .story-detail__content{
        font-size: 15px;
        line-height: 1.9;
    }
    .story-detail__action-btn{
        font-size: 12px;
        padding: 6px 7px;
        gap: 2px;
    }
    .story-detail__action-btn svg{
        width: 14px;
    }
    .story-card__actions{
        gap: 12px;
    }
    .story-card__date{
        font-size: 12px;
    }
    .story-other-stories{
        margin-top: 24px;
    }
}

/* ========================================
   この人のストーリー
   ======================================== */
.story-other-stories__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.story-other-stories__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.story-other-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.story-other-card__thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
    overflow: hidden;
}

.story-other-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.story-other-card__thumbnail:hover img{
    transform: scale(1.05);
}
.story-other-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 24px;
}

.story-other-card__title {
    font-size: 13px;
    line-height: 1.3;
}

.story-other-stories__more-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 13px;
    text-decoration: none;
    width: 100%;
    margin-top: 16px;
    line-height: 1;
}
.story-other-stories__more-link .material-symbols-outlined{
    font-size: 16px;
    color: var(--maincolor);
}
.story-other-stories__more-link:hover {
    opacity: 0.8;
}
